logger: Rename SHOW_COLOR and FORMAT_TIMESTAMP options
Make options available for other backends
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
diff --git a/doc/subsystems/logging/logger.rst b/doc/subsystems/logging/logger.rst
index af04b6d..46f402d 100644
--- a/doc/subsystems/logging/logger.rst
+++ b/doc/subsystems/logging/logger.rst
@@ -124,10 +124,10 @@
:option:`CONFIG_LOG_BACKEND_UART`: Enabled build-in UART backend.
-:option:`CONFIG_LOG_BACKEND_UART_SHOW_COLOR`: Enables coloring of errors (red)
+:option:`CONFIG_LOG_BACKEND_SHOW_COLOR`: Enables coloring of errors (red)
and warnings (yellow).
-:option:`CONFIG_LOG_BACKEND_UART_FORMAT_TIMESTAMP`: If enabled timestamp is
+:option:`CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP`: If enabled timestamp is
formatted to *hh:mm:ss:mmm,uuu*. Otherwise is printed in raw format.
.. _log_usage:
diff --git a/subsys/logging/Kconfig b/subsys/logging/Kconfig
index 38734f4..4843e0e 100644
--- a/subsys/logging/Kconfig
+++ b/subsys/logging/Kconfig
@@ -270,15 +270,15 @@
help
When enabled backend is using UART to output logs.
-config LOG_BACKEND_UART_SHOW_COLOR
- bool "Enable colors in the UART backend"
+config LOG_BACKEND_SHOW_COLOR
+ bool "Enable colors in the backend"
depends on LOG_BACKEND_UART
default y
help
When enabled UART backend prints errors in red and warning in yellow.
-config LOG_BACKEND_UART_FORMAT_TIMESTAMP
- bool "Enable timestamp formatting in the UART backend"
+config LOG_BACKEND_FORMAT_TIMESTAMP
+ bool "Enable timestamp formatting in the backend"
depends on LOG_BACKEND_UART
default y
help
diff --git a/subsys/logging/log_backend_uart.c b/subsys/logging/log_backend_uart.c
index f0975fc..8088132 100644
--- a/subsys/logging/log_backend_uart.c
+++ b/subsys/logging/log_backend_uart.c
@@ -33,11 +33,11 @@
u32_t flags = 0;
- if (IS_ENABLED(CONFIG_LOG_BACKEND_UART_SHOW_COLOR)) {
+ if (IS_ENABLED(CONFIG_LOG_BACKEND_SHOW_COLOR)) {
flags |= LOG_OUTPUT_FLAG_COLORS;
}
- if (IS_ENABLED(CONFIG_LOG_BACKEND_UART_FORMAT_TIMESTAMP)) {
+ if (IS_ENABLED(CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP)) {
flags |= LOG_OUTPUT_FLAG_FORMAT_TIMESTAMP;
}