" this time passed\n"
" --log-level[=LEVEL] Increase or set verbosity level\n"
" -v Increase the verbosity level\n"
+#ifdef USE_DLOG
+ " --log-target={auto,syslog,stderr,file:PATH,newfile:PATH,dlog,dlog-color}\n"
+#else
" --log-target={auto,syslog,stderr,file:PATH,newfile:PATH}\n"
+#endif
" Specify the log target\n"
" --log-meta[=BOOL] Include code location in log messages\n"
" --log-time[=BOOL] Include timestamps in log messages\n"
case ARG_LOG_TARGET:
if (pa_daemon_conf_set_log_target(conf, optarg) < 0) {
+#ifdef USE_DLOG
+ pa_log(_("Invalid log target: use either 'syslog', 'stderr' or 'auto' or a valid file name 'file:<path>', 'newfile:<path>' or 'dlog' or 'dlog-color'."));
+#else
pa_log(_("Invalid log target: use either 'syslog', 'stderr' or 'auto' or a valid file name 'file:<path>', 'newfile:<path>'."));
+#endif
goto fail;
}
break;
if (!log_target)
return -1;
- c->log_target = log_target;
+ c->log_target = log_target;
}
-#ifdef USE_DLOG
- else if (!strcmp(string, "dlog")) {
- c->log_target = PA_LOG_DLOG;
- } else if (!strcmp(string, "dlog-color")) {
- c->log_target = PA_LOG_DLOG_COLOR;
- }
-#endif
return 0;
}
{ "kill-client", pa_cli_command_kill_client, "Kill a client (args: index)", 2},
{ "kill-sink-input", pa_cli_command_kill_sink_input, "Kill a sink input (args: index)", 2},
{ "kill-source-output", pa_cli_command_kill_source_output, "Kill a source output (args: index)", 2},
+#ifdef USE_DLOG
+ { "set-log-target", pa_cli_command_log_target, "Change the log target (args: null|auto|syslog|stderr|file:PATH|newfile:PATH|dlog|dlog-color)", 2},
+#else
{ "set-log-target", pa_cli_command_log_target, "Change the log target (args: null|auto|syslog|stderr|file:PATH|newfile:PATH)", 2},
+#endif
{ "set-log-level", pa_cli_command_log_level, "Change the log level (args: numeric level)", 2},
{ "set-log-meta", pa_cli_command_log_meta, "Show source code location in log messages (args: bool)", 2},
{ "set-log-time", pa_cli_command_log_time, "Show timestamps in log messages (args: bool)", 2},
pa_assert(fail);
if (!(m = pa_tokenizer_get(t, 1))) {
+#ifdef USE_DLOG
+ pa_strbuf_puts(buf, "You need to specify a log target (null|auto|syslog|stderr|file:PATH|newfile:PATH|dlog|dlog-color).\n");
+#else
pa_strbuf_puts(buf, "You need to specify a log target (null|auto|syslog|stderr|file:PATH|newfile:PATH).\n");
+#endif
return -1;
}
t = pa_log_target_new(PA_LOG_FILE, string + 5);
else if (pa_startswith(string, "newfile:"))
t = pa_log_target_new(PA_LOG_NEWFILE, string + 8);
+#ifdef USE_DLOG
+ else if (pa_streq(string, "dlog"))
+ t = pa_log_target_new(PA_LOG_DLOG, NULL);
+ else if (pa_streq(string, "dlog-color"))
+ t = pa_log_target_new(PA_LOG_DLOG_COLOR, NULL);
+#endif
else
pa_log(_("Invalid log target."));