diff --git a/doc/reference/logging/index.rst b/doc/reference/logging/index.rst index af78966316a..3e21b2b7753 100644 --- a/doc/reference/logging/index.rst +++ b/doc/reference/logging/index.rst @@ -51,8 +51,8 @@ Logging v2 introduces following changes: - Logging backend API exteded with function for processing v2 messages. .. note:: - Logging v1 is deprecated! Version 2 supports same set of features with listed - above extensions. However, logging backend API is different. All backends in + Logging v1 is deprecated! Version 2 supports same set of features with extensions + listed above. However, logging backend API is different. All backends in the tree support version 2 API. Any custom backend must be adapted to version 2. Version 1 support will be removed after 3.1 release. diff --git a/subsys/logging/CMakeLists.txt b/subsys/logging/CMakeLists.txt index 19416745394..187509d2779 100644 --- a/subsys/logging/CMakeLists.txt +++ b/subsys/logging/CMakeLists.txt @@ -92,7 +92,7 @@ if(CONFIG_LOG2_MODE_IMMEDIATE OR CONFIG_LOG2_MODE_DEFERRED) endif() if(CONFIG_LOG1) - message(WARNING "Logging v1 has been deprecated. Use v2 and instead and adapt \ + message(WARNING "Logging v1 has been deprecated. Use v2 instead and adapt \ custom backend to the new backend API"  ) endif() diff --git a/subsys/logging/log_mgmt.c b/subsys/logging/log_mgmt.c index 6d8ee4b8423..b5eeb10d7ff 100644 --- a/subsys/logging/log_mgmt.c +++ b/subsys/logging/log_mgmt.c @@ -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);