summaryrefslogtreecommitdiffstats
path: root/polyp/cmdline.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-12-11 00:10:41 +0000
committerLennart Poettering <lennart@poettering.net>2004-12-11 00:10:41 +0000
commit73eabece3365c1bb47bf6b009682219c4492fda5 (patch)
tree907b66e2fe29705a512e5f3a240210590b8fe9ba /polyp/cmdline.c
parent5be9641ffe18c482294c99345306c382ba4cf750 (diff)
* add first part of zeroconf publisher
* bump version to 0.7.1. * improve logging subsystem (introducing log levels) * remove verbose flag on cli * add new API pa_sample_format_to_string() * replace strtol() by usages of pa_atou() and pa_atoi() git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@317 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/cmdline.c')
-rw-r--r--polyp/cmdline.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/polyp/cmdline.c b/polyp/cmdline.c
index a39f6ca6..0951725a 100644
--- a/polyp/cmdline.c
+++ b/polyp/cmdline.c
@@ -43,7 +43,7 @@ enum {
ARG_DUMP_MODULES,
ARG_DAEMONIZE,
ARG_FAIL,
- ARG_VERBOSE,
+ ARG_LOG_LEVEL,
ARG_HIGH_PRIORITY,
ARG_DISALLOW_MODULE_LOADING,
ARG_EXIT_IDLE_TIME,
@@ -67,7 +67,8 @@ static struct option long_options[] = {
{"dump-modules", 0, 0, ARG_DUMP_MODULES},
{"daemonize", 2, 0, ARG_DAEMONIZE},
{"fail", 2, 0, ARG_FAIL},
- {"verbose", 2, 0, ARG_VERBOSE},
+ {"verbose", 2, 0, ARG_LOG_LEVEL},
+ {"log-level", 2, 0, ARG_LOG_LEVEL},
{"high-priority", 2, 0, ARG_HIGH_PRIORITY},
{"disallow-module-loading", 2, 0, ARG_DISALLOW_MODULE_LOADING},
{"exit-idle-time", 2, 0, ARG_EXIT_IDLE_TIME},
@@ -104,7 +105,6 @@ void pa_cmdline_help(const char *argv0) {
"OPTIONS:\n"
" -D, --daemonize[=BOOL] Daemonize after startup\n"
" --fail[=BOOL] Quit when startup fails\n"
- " --verbose[=BOOL] Be slightly more verbose\n"
" --high-priority[=BOOL] Try to set high process priority\n"
" (only available as root)\n"
" --disallow-module-loading[=BOOL] Disallow module loading after startup\n"
@@ -114,6 +114,8 @@ void pa_cmdline_help(const char *argv0) {
" this time passed\n"
" --scache-idle-time=SECS Unload autoloaded samples when idle and\n"
" this time passed\n"
+ " --log-level[=LEVEL] Increase or set verbosity level\n"
+ " -v Increase the verbosity level\n"
" --log-target={auto,syslog,stderr} Specify the log target\n"
" -p, --dl-search-path=PATH Set the search path for dynamic shared\n"
" objects (plugins)\n"
@@ -143,7 +145,7 @@ int pa_cmdline_parse(struct pa_daemon_conf *conf, int argc, char *const argv [],
if (conf->script_commands)
pa_strbuf_puts(buf, conf->script_commands);
- while ((c = getopt_long(argc, argv, "L:F:ChDnp:k", long_options, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "L:F:ChDnp:kv", long_options, NULL)) != -1) {
switch (c) {
case ARG_HELP:
case 'h':
@@ -200,11 +202,19 @@ int pa_cmdline_parse(struct pa_daemon_conf *conf, int argc, char *const argv [],
}
break;
- case ARG_VERBOSE:
- if ((conf->verbose = optarg ? pa_parse_boolean(optarg) : 1) < 0) {
- pa_log(__FILE__": --verbose expects boolean argument\n");
- goto fail;
+ case 'v':
+ case ARG_LOG_LEVEL:
+
+ if (optarg) {
+ if (pa_daemon_conf_set_log_level(conf, optarg) < 0) {
+ pa_log(__FILE__": --log-level expects log level argument (either numeric in range 0..4 or one of debug, info, notice, warn, error).\n");
+ goto fail;
+ }
+ } else {
+ if (conf->log_level < PA_LOG_LEVEL_MAX-1)
+ conf->log_level++;
}
+
break;
case ARG_HIGH_PRIORITY: