diff --git a/src/logging.c b/src/logging.c index d32ca43a7..b0bca5490 100644 --- a/src/logging.c +++ b/src/logging.c @@ -577,8 +577,9 @@ void log_set_log_level(struct log_target *target, int log_level) void log_set_category_filter(struct log_target *target, int category, int enable, int level) { - if (category >= osmo_log_info->num_cat) + if (!target) return; + category = map_subsys(category); target->categories[category].enabled = !!enable; target->categories[category].loglevel = level; } diff --git a/tests/logging/logging_test.err b/tests/logging/logging_test.err index 4527d8351..17b3cad06 100644 --- a/tests/logging/logging_test.err +++ b/tests/logging/logging_test.err @@ -6,3 +6,4 @@ DLGLOBAL You should see this on DLGLOBAL (b) DLGLOBAL You should see this on DLGLOBAL (c) DLGLOBAL You should see this on DLGLOBAL (d) DLGLOBAL You should see this on DLGLOBAL (e) +DLGLOBAL You should see this (DLGLOBAL on DEBUG)