Follow up fix for the log level "everything"
Commit cd6ed82d1ff48f47ad9e33e6322df62896a76ed5 made "EVERYTHING"
map to LOGL_DEBUG but when writing out the configuration the following
would be written:
logging level all unknown 0x0
This happend because no string was found for the value 0. Address it
by adding a legacy check for 0 and write out the str from the index
0. Currently this is "EVERYTHING".
diff --git a/src/logging.c b/src/logging.c
index f64fd3c..eab8bdf 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -135,6 +135,9 @@
/*! \brief convert a numeric log level into human-readable string */
const char *log_level_str(unsigned int lvl)
{
+ /* backwards compatibility */
+ if (lvl == 0)
+ return loglevel_strs[0].str;
return get_value_string(loglevel_strs, lvl);
}