" -v Verbose startup\n"
" -X SECS Terminate the daemon after the last client quit and this time passed\n"
" -h Show this help\n"
+ " -l TARGET Specify the log target (syslog, stderr, auto)\n"
" -V Show version\n", e, cfg);
pa_xfree(cfg);
cmdline->stay_root =
cmdline->version =
cmdline->disallow_module_loading = 0;
- cmdline->fail = 1;
+ cmdline->fail = cmdline->auto_log_target = 1;
cmdline->quit_after_last_client_time = -1;
+ cmdline->log_target = -1;
buf = pa_strbuf_new();
assert(buf);
- while ((c = getopt(argc, argv, "L:F:CDhfvrRVndX:")) != -1) {
+ while ((c = getopt(argc, argv, "L:F:CDhfvrRVndX:l:")) != -1) {
switch (c) {
case 'L':
pa_strbuf_printf(buf, "load %s\n", optarg);
case 'X':
cmdline->quit_after_last_client_time = atoi(optarg);
break;
+ case 'l':
+ if (!strcmp(optarg, "syslog")) {
+ cmdline->auto_log_target = 0;
+ cmdline->log_target = PA_LOG_SYSLOG;
+ } else if (!strcmp(optarg, "stderr")) {
+ cmdline->auto_log_target = 0;
+ cmdline->log_target = PA_LOG_STDERR;
+ } else if (!strcmp(optarg, "auto"))
+ cmdline->auto_log_target = 1;
+ else {
+ pa_log(__FILE__": Invalid log target: use either 'syslog', 'stderr' or 'auto'.\n");
+ goto fail;
+ }
+ break;
default:
goto fail;
}