logging: Fix LOG_OVERRIDE_LEVEL option

When option is set whole logs shall be set to minimum
of CONFIG_LOG_OVERRIDE_LEVEL. However, module was not
registered when module specific level was set to NONE.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2022-03-26 06:54:18 +01:00 committed by Carles Cufí
commit 653cda5029
2 changed files with 16 additions and 7 deletions

View file

@ -37,6 +37,7 @@ void z_log_runtime_filters_init(void)
uint32_t *filters = z_log_dynamic_filters_get(i);
uint8_t level = log_compiled_level_get(i);
level = MAX(level, CONFIG_LOG_OVERRIDE_LEVEL);
LOG_FILTER_SLOT_SET(filters,
LOG_FILTER_AGGR_SLOT_IDX,
level);
@ -109,7 +110,7 @@ uint32_t z_impl_log_filter_set(struct log_backend const *const backend,
uint32_t max = log_filter_get(backend, domain_id,
source_id, false);
level = MIN(level, max);
level = MIN(level, MAX(max, CONFIG_LOG_OVERRIDE_LEVEL));
LOG_FILTER_SLOT_SET(filters,
log_backend_id_get(backend),