Browse Source

shell: Allow custom shell log backend implementation

Shell is capable of acting as the logging backend and multiplex
logging messages with shell content. It expects that logging
messages goes through the logging backend. However, there is an
option that logs go only to the custom logging frontend. In
that case this default approach does not work and logging
frontend cannot be easily integrated with the shell (due to
its custom nature). Add Kconfig option SHELL_LOG_BACKEND_OOB
which prevent compilation of the default shell log backend.
When enabled, application can provide frontend specific
implementation to integrate shell with the logging.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
pull/79546/head
Krzysztof Chruściński 9 months ago committed by Anas Nashif
parent
commit
05dd68a377
  1. 8
      subsys/shell/CMakeLists.txt
  2. 7
      subsys/shell/Kconfig

8
subsys/shell/CMakeLists.txt

@ -11,10 +11,12 @@ zephyr_sources_ifdef( @@ -11,10 +11,12 @@ zephyr_sources_ifdef(
shell_ops.c
)
zephyr_sources_ifdef(
CONFIG_SHELL_LOG_BACKEND
shell_log_backend.c
if(NOT CONFIG_SHELL_LOG_BACKEND_CUSTOM)
zephyr_sources_ifdef(
CONFIG_SHELL_LOG_BACKEND
shell_log_backend.c
)
endif()
zephyr_sources_ifdef(
CONFIG_SHELL_HELP

7
subsys/shell/Kconfig

@ -277,6 +277,13 @@ config SHELL_LOG_BACKEND @@ -277,6 +277,13 @@ config SHELL_LOG_BACKEND
using the shell backend's LOG_LEVEL option
(e.g. CONFIG_SHELL_TELNET_INIT_LOG_LEVEL_NONE=y).
config SHELL_LOG_BACKEND_CUSTOM
bool "Use custom backend implementation"
help
When enabled, standard implementation of shell log backend is not included.
It allows to provide custom implementation of multiplexing logging messages
with shell data.
config SHELL_LOG_FORMAT_TIMESTAMP
bool "Format timestamp"
default y

Loading…
Cancel
Save