Follow up fix for the log level "everything"

Commit cd6ed82d1f 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".
This commit is contained in:
Holger Hans Peter Freyther 2013-02-27 15:32:51 +01:00
parent 3309a43ef5
commit a6428d2376
1 changed files with 3 additions and 0 deletions

View File

@ -135,6 +135,9 @@ int log_parse_level(const char *lvl)
/*! \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);
}