logger: Rename SHOW_COLOR and FORMAT_TIMESTAMP options

Make options available for other backends

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2018-09-14 09:52:16 +03:00 committed by Carles Cufí
commit 70f046e396
3 changed files with 8 additions and 8 deletions

View file

@ -124,10 +124,10 @@ arguments or hexdump message with 12 bytes of data take 32 bytes.
: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:

View file

@ -270,15 +270,15 @@ config LOG_BACKEND_UART
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

View file

@ -33,11 +33,11 @@ static void put(const struct log_backend *const backend,
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;
}