diff --git a/ChangeLog.md b/ChangeLog.md index 63b0c913..76492fff 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -9,6 +9,7 @@ * added trailing wildcard to "ebuspicloader" port * added i386 and arm64 architectures to docker image * added more startup logging +* added colon as additional separator for "--log" option # 21.1 (2021-01-10) diff --git a/src/ebusd/main.cpp b/src/ebusd/main.cpp index 80a0d2b7..658f529f 100644 --- a/src/ebusd/main.cpp +++ b/src/ebusd/main.cpp @@ -229,8 +229,8 @@ static const struct argp_option argpoptions[] = { {nullptr, 0, nullptr, 0, "Log options:", 5 }, {"logfile", 'l', "FILE", 0, "Write log to FILE (only for daemon, empty string for using syslog) [" PACKAGE_LOGFILE "]", 0 }, - {"log", O_LOG, "AREAS LEVEL", 0, "Only write log for matching AREA(S) below or equal to LEVEL" - " (alternative to --logareas/--logevel, may be used multiple times) [all notice]", 0 }, + {"log", O_LOG, "AREAS:LEVEL", 0, "Only write log for matching AREA(S) below or equal to LEVEL" + " (alternative to --logareas/--logevel, may be used multiple times) [all:notice]", 0 }, {"logareas", O_LOGARE, "AREAS", 0, "Only write log for matching AREA(S): main|network|bus|update|other" "|all [all]", 0 }, {"loglevel", O_LOGLEV, "LEVEL", 0, "Only write log below or equal to LEVEL: error|notice|info|debug" @@ -503,12 +503,15 @@ error_t parse_opt(int key, char *arg, struct argp_state *state) { } opt->logFile = arg; break; - case O_LOG: // --log=area(s) level + case O_LOG: // --log=area(s):level { - char* pos = strchr(arg, ' '); + char* pos = strchr(arg, ':'); if (pos == nullptr) { - argp_error(state, "invalid log"); - return EINVAL; + pos = strchr(arg, ' '); + if (pos == nullptr) { + argp_error(state, "invalid log"); + return EINVAL; + } } *pos = 0; int facilities = parseLogFacilities(arg);