LogInit: provide mappings for LogLevel::{ERROR,WARNING}

This commit is contained in:
Max Kellermann 2020-09-23 13:49:55 +02:00
parent 3e0ceb12d5
commit e3106a019d
2 changed files with 6 additions and 0 deletions

View File

@ -81,6 +81,8 @@ log_level <default, secure, or verbose>
Suppress all messages below the given threshold. The following Suppress all messages below the given threshold. The following
log levels are available: log levels are available:
- :samp:`error`: errors
- :samp:`warning`: warnings
- :samp:`default`: interesting informational messages - :samp:`default`: interesting informational messages
- :samp:`info`: unimportant informational messages - :samp:`info`: unimportant informational messages
- :samp:`verbose`: debug messages (for developers and for - :samp:`verbose`: debug messages (for developers and for

View File

@ -103,6 +103,10 @@ parse_log_level(const char *value)
return LogLevel::INFO; return LogLevel::INFO;
else if (StringIsEqual(value, "verbose")) else if (StringIsEqual(value, "verbose"))
return LogLevel::DEBUG; return LogLevel::DEBUG;
else if (StringIsEqual(value, "warning"))
return LogLevel::WARNING;
else if (StringIsEqual(value, "error"))
return LogLevel::ERROR;
else else
throw FormatRuntimeError("unknown log level \"%s\"", value); throw FormatRuntimeError("unknown log level \"%s\"", value);
} }