]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
main: add -S or --nosyslog option to disable completely syslog logging, fixes #2787
authorJaroslav Kysela <perex@perex.cz>
Fri, 1 May 2015 16:14:03 +0000 (18:14 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 1 May 2015 16:14:03 +0000 (18:14 +0200)
src/main.c

index ed06ff307fcc8dd8885cd9a30657a48ee041feb3..95784a22c05425f76cdedbb060bb2052aa6ebd49 100644 (file)
@@ -600,6 +600,7 @@ main(int argc, char **argv)
               opt_firstrun     = 0,
               opt_stderr       = 0,
               opt_syslog       = 0,
+              opt_nosyslog     = 0,
               opt_uidebug      = 0,
               opt_abort        = 0,
               opt_noacl        = 0,
@@ -687,6 +688,7 @@ main(int argc, char **argv)
     {   0, NULL,        "Debug Options",           OPT_BOOL, NULL         },
     { 'd', "stderr",    "Enable debug on stderr",  OPT_BOOL, &opt_stderr  },
     { 's', "syslog",    "Enable debug to syslog",  OPT_BOOL, &opt_syslog  },
+    { 'S', "nosyslog",  "Disable syslog (all msgs)", OPT_BOOL, &opt_nosyslog },
     { 'l', "logfile",   "Enable debug to file",    OPT_STR,  &opt_logpath },
     {   0, "debug",     "Enable debug subsystems", OPT_STR,  &opt_log_debug },
 #if ENABLE_TRACE
@@ -819,6 +821,8 @@ main(int argc, char **argv)
     if (opt_logpath)
       log_options   |= TVHLOG_OPT_DBG_FILE;
   }
+  if (opt_nosyslog)
+    log_options &= ~(TVHLOG_OPT_SYSLOG|TVHLOG_OPT_DBG_SYSLOG);
   if (opt_fileline)
     log_options |= TVHLOG_OPT_FILELINE;
   if (opt_threadid)