From 814aa381c4bd3dfa8a0befe55e932157d306d5a4 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Thu, 9 Jan 2025 15:56:14 +0100 Subject: [PATCH] shell: websocket: Fix duplicate logs over websocket shell backend In case websocket logging is enabled, the websocket shell should not be configured as a logger backend, otherwise logs are duplicated. Signed-off-by: Robert Lubos --- subsys/shell/backends/shell_websocket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/shell/backends/shell_websocket.c b/subsys/shell/backends/shell_websocket.c index 7590decaf32..f497147f0ce 100644 --- a/subsys/shell/backends/shell_websocket.c +++ b/subsys/shell/backends/shell_websocket.c @@ -386,7 +386,8 @@ int shell_websocket_setup(int ws_socket, struct http_request_ctx *request_ctx, v int shell_websocket_enable(const struct shell *sh) { - bool log_backend = CONFIG_SHELL_WEBSOCKET_INIT_LOG_LEVEL > 0; + bool log_backend = CONFIG_SHELL_WEBSOCKET_INIT_LOG_LEVEL > 0 && + !IS_ENABLED(CONFIG_LOG_BACKEND_WS); uint32_t level = (CONFIG_SHELL_WEBSOCKET_INIT_LOG_LEVEL > LOG_LEVEL_DBG) ? CONFIG_LOG_MAX_LEVEL : CONFIG_SHELL_WEBSOCKET_INIT_LOG_LEVEL; static const struct shell_backend_config_flags cfg_flags =