Skip to content

Commit

Permalink
add -s option to enable log to syslog
Browse files Browse the repository at this point in the history
  • Loading branch information
荒野無燈 authored and liudf0716 committed May 16, 2017
1 parent 65a1405 commit 91ae7da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions commandline.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ usage(const char *appname)
fprintf(stdout, " -c [filename] Use this config file\n");
fprintf(stdout, " -f Run in foreground\n");
fprintf(stdout, " -d <level> Debug level\n");
fprintf(stdout, " -s Log to syslog\n");
fprintf(stdout, " -h Print usage\n");
fprintf(stdout, " -v Print version information\n");
fprintf(stdout, "\n");
Expand Down Expand Up @@ -91,6 +92,11 @@ parse_commandline(int argc, char **argv)
}
break;

case 's':
debugconf.log_syslog = 1;
debugconf.log_stderr = 0;
break;

case 'v':
fprintf(stdout, "This is %s version " VERSION "\n", argv[0]);
exit(1);
Expand Down
2 changes: 1 addition & 1 deletion debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ debugconf_t debugconf = {
.debuglevel = LOG_INFO,
.log_stderr = 1,
.log_syslog = 0,
.syslog_facility = 0
.syslog_facility = LOG_USER
};

/** @internal
Expand Down

0 comments on commit 91ae7da

Please sign in to comment.