zephyr/subsys/logging/backends/Kconfig.uart
Trent Piepho 2112844eea logging: backend_uart: Reword buffer size Kconfig text
As written, the title and description of the Kconfig option seem to
specify the logging sub-system will not flush until the buffer is full.
Someone reading this would expect that shorter log message will not be
flushed until the specified number of bytes accumulate.

This is not the case.  Each log message is flushed when finished.  The
size is only the maximum bytes of a single formatted message's contents
that will be accumated before the backend flushes.

What's more, it only applies in deferred mode.  In immediate mode there
is no buffering, not just of multiple log messages but also of the
message contents as they are formatted.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
2022-12-21 12:23:23 +01:00

64 lines
1.8 KiB
Plaintext

# Copyright (c) 2021 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
config LOG_BACKEND_UART
bool "UART backend"
depends on UART_CONSOLE
default y if !SHELL_BACKEND_SERIAL
select LOG_OUTPUT
help
When enabled backend is using UART to output logs.
if LOG_BACKEND_UART
config LOG_BACKEND_UART_ASYNC
bool "Use UART Asynchronous API"
depends on UART_ASYNC_API
depends on !LOG_BACKEND_UART_OUTPUT_DICTIONARY_HEX
config LOG_BACKEND_UART_BUFFER_SIZE
int "Maximum number of bytes to buffer in RAM before flushing"
default 32 if LOG_BACKEND_UART_ASYNC
default 1
help
In deferred logging mode, sets the maximum number of bytes which can be buffered in
RAM before log_output_flush is automatically called on the UART backend. The buffer
will also be flushed after each log message.
In immediate logging mode, processed log messages are not buffered and are always
output one byte at a time.
config LOG_BACKEND_UART_AUTOSTART
bool "Automatically start UART backend"
default y
help
When enabled automatically start the UART logging backend on
application start. When disabled, the application needs to start
the backend manually using log_backend_enable().
backend = UART
backend-str = uart
source "subsys/logging/Kconfig.template.log_format_config"
if LOG_BACKEND_UART_OUTPUT_DICTIONARY
choice
prompt "Dictionary mode output format"
default LOG_BACKEND_UART_OUTPUT_DICTIONARY_BIN
config LOG_BACKEND_UART_OUTPUT_DICTIONARY_BIN
bool "Dictionary (binary)"
help
Dictionary-based logging output in binary.
config LOG_BACKEND_UART_OUTPUT_DICTIONARY_HEX
bool "Dictionary (hexadecimal)"
help
Dictionary-based logging output in hexadecimal. Supported only for UART backend.
endchoice
endif # LOG_BACKEND_UART_OUTPUT_DICTIONARY
endif # LOG_BACKEND_UART