From e3106a019d2909c2fdc9fd0e29e60389eb87761d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 23 Sep 2020 13:49:55 +0200 Subject: [PATCH] LogInit: provide mappings for LogLevel::{ERROR,WARNING} --- doc/mpd.conf.5.rst | 2 ++ src/LogInit.cxx | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/doc/mpd.conf.5.rst b/doc/mpd.conf.5.rst index e48c17df7..a542569b2 100644 --- a/doc/mpd.conf.5.rst +++ b/doc/mpd.conf.5.rst @@ -81,6 +81,8 @@ log_level Suppress all messages below the given threshold. The following log levels are available: + - :samp:`error`: errors + - :samp:`warning`: warnings - :samp:`default`: interesting informational messages - :samp:`info`: unimportant informational messages - :samp:`verbose`: debug messages (for developers and for diff --git a/src/LogInit.cxx b/src/LogInit.cxx index d6070ed04..3fcbdcfda 100644 --- a/src/LogInit.cxx +++ b/src/LogInit.cxx @@ -103,6 +103,10 @@ parse_log_level(const char *value) return LogLevel::INFO; else if (StringIsEqual(value, "verbose")) return LogLevel::DEBUG; + else if (StringIsEqual(value, "warning")) + return LogLevel::WARNING; + else if (StringIsEqual(value, "error")) + return LogLevel::ERROR; else throw FormatRuntimeError("unknown log level \"%s\"", value); }