shell: websocket: Fix build with websocket logger disabled

In case websocket logger is disabled, the websocket shell backend should
still build, fix that.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2025-01-09 15:57:13 +01:00 committed by Benjamin Cabé
parent 814aa381c4
commit 60f5337a7a

View file

@ -35,7 +35,9 @@ static void ws_end_client_connection(struct shell_websocket *ws)
LOG_DBG("Closing connection to #%d", ws->fds[0].fd); LOG_DBG("Closing connection to #%d", ws->fds[0].fd);
(void)log_backend_ws_unregister(ws->fds[0].fd); if (IS_ENABLED(CONFIG_LOG_BACKEND_WS)) {
(void)log_backend_ws_unregister(ws->fds[0].fd);
}
(void)websocket_unregister(ws->fds[0].fd); (void)websocket_unregister(ws->fds[0].fd);
@ -212,8 +214,9 @@ static int shell_ws_init(struct shell_websocket *ctx, int ws_socket)
LOG_ERR("Failed to register socket service, %d", ret); LOG_ERR("Failed to register socket service, %d", ret);
goto error; goto error;
} }
if (IS_ENABLED(CONFIG_LOG_BACKEND_WS)) {
log_backend_ws_register(ws_socket); log_backend_ws_register(ws_socket);
}
return 0; return 0;