samples: syslog_net: correctly late-initialize log backend

log_backend_activate() does not assign the backend id (backend->ctx->id),
which is required for runtime filtering.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
This commit is contained in:
Armin Brauns 2022-11-30 15:28:51 +01:00 committed by Carles Cufí
parent 916e02563c
commit b923f962aa
1 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ LOG_MODULE_REGISTER(net_syslog, LOG_LEVEL_DBG);
#include <zephyr/kernel.h>
#include <zephyr/logging/log_backend.h>
#include <zephyr/logging/log_ctrl.h>
#include <stdlib.h>
@ -39,7 +40,7 @@ void main(void)
backend->api->init(backend);
}
log_backend_activate(backend, NULL);
log_backend_enable(backend, backend->cb->ctx, CONFIG_LOG_MAX_LEVEL);
}
}