summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-11 11:19:40 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-11 11:19:40 +0200
commit9ac2225ff43e7ec74ec6a629383899f3b6e78d2c (patch)
tree8172360ffe0827a2717e31f6ed0c3b3a98fc092f
parent95df5c0179f6b24d31c6720a43434755ed58aa22 (diff)
logging: introuduce log_level_str() to obtain the name of a log level
-rw-r--r--include/osmocore/logging.h1
-rw-r--r--src/logging.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/include/osmocore/logging.h b/include/osmocore/logging.h
index 93f18a07..b9e0c8fd 100644
--- a/include/osmocore/logging.h
+++ b/include/osmocore/logging.h
@@ -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);
diff --git a/src/logging.c b/src/logging.c
index 7c508771..e5d459a0 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -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;