logging: Add assert when wrong backend is used
Add assert when logging v2 is enabled but backend doesn't support it. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
262cc55609
commit
aff9cfc65a
3 changed files with 7 additions and 3 deletions
|
@ -169,6 +169,10 @@ void log_backend_enable(struct log_backend const *const backend,
|
|||
|
||||
id += backend - log_backend_get(0);
|
||||
|
||||
if (!IS_ENABLED(CONFIG_LOG1)) {
|
||||
__ASSERT(backend->api->process, "Backend does not support v2 API");
|
||||
}
|
||||
|
||||
log_backend_id_set(backend, id);
|
||||
backend_filter_set(backend, level);
|
||||
log_backend_activate(backend, ctx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue