logging: introuduce log_level_str() to obtain the name of a log level

This commit is contained in:
Harald Welte 2010-05-11 11:19:40 +02:00
parent 95df5c0179
commit 9ac2225ff4
2 changed files with 6 additions and 0 deletions

View File

@ -117,6 +117,7 @@ void log_set_print_timestamp(struct log_target *target, int);
void log_set_log_level(struct log_target *target, int log_level);
void log_parse_category_mask(struct log_target *target, const char* mask);
int log_parse_level(const char *lvl);
const char *log_level_str(unsigned int lvl);
int log_parse_category(const char *category);
void log_set_category_filter(struct log_target *target, int category,
int enable, int level);

View File

@ -58,6 +58,11 @@ int log_parse_level(const char *lvl)
return get_string_value(loglevel_strs, lvl);
}
const char *log_level_str(unsigned int lvl)
{
return get_value_string(loglevel_strs, lvl);
}
int log_parse_category(const char *category)
{
int i;