]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
main: add -n,--nostderr option
authorJaroslav Kysela <perex@perex.cz>
Thu, 26 Nov 2015 16:03:03 +0000 (17:03 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 26 Nov 2015 16:03:03 +0000 (17:03 +0100)
src/main.c

index 12f9227f383448788062eac5e8fc7563aa92a59d..7452f94cdd2d864ed478dcaaff9b2b67bad9b4e4 100644 (file)
@@ -623,6 +623,7 @@ main(int argc, char **argv)
               opt_fork         = 0,
               opt_firstrun     = 0,
               opt_stderr       = 0,
+              opt_nostderr     = 0,
               opt_syslog       = 0,
               opt_nosyslog     = 0,
               opt_uidebug      = 0,
@@ -715,6 +716,7 @@ main(int argc, char **argv)
 
     {   0, NULL,        N_("Debug options"),           OPT_BOOL, NULL         },
     { 'd', "stderr",    N_("Enable debug on stderr"),  OPT_BOOL, &opt_stderr  },
+    { 'n', "nostderr",  N_("Disable debug on stderr"), OPT_BOOL, &opt_nostderr },
     { 's', "syslog",    N_("Enable debug to syslog"),  OPT_BOOL, &opt_syslog  },
     { 'S', "nosyslog",  N_("Disable syslog (all messages)"), OPT_BOOL, &opt_nosyslog },
     { 'l', "logfile",   N_("Enable debug to file"),    OPT_STR,  &opt_logpath },
@@ -859,6 +861,8 @@ main(int argc, char **argv)
     if (opt_logpath)
       log_options   |= TVHLOG_OPT_DBG_FILE;
   }
+  if (opt_nostderr)
+    log_options &= ~(TVHLOG_OPT_DECORATE|TVHLOG_OPT_STDERR|TVHLOG_OPT_DBG_STDERR);
   if (opt_nosyslog)
     log_options &= ~(TVHLOG_OPT_SYSLOG|TVHLOG_OPT_DBG_SYSLOG);
   if (opt_fileline)