From 2112844eea20729c4de2bd256d8d8d8eeba84629 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Mon, 19 Dec 2022 18:52:05 -0800 Subject: [PATCH] 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 --- subsys/logging/backends/Kconfig.uart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/subsys/logging/backends/Kconfig.uart b/subsys/logging/backends/Kconfig.uart index 5cb89a1ec8f..43b544ab66a 100644 --- a/subsys/logging/backends/Kconfig.uart +++ b/subsys/logging/backends/Kconfig.uart @@ -17,12 +17,16 @@ config LOG_BACKEND_UART_ASYNC depends on !LOG_BACKEND_UART_OUTPUT_DICTIONARY_HEX config LOG_BACKEND_UART_BUFFER_SIZE - int "Number of bytes to buffer in RAM before flushing" + int "Maximum number of bytes to buffer in RAM before flushing" default 32 if LOG_BACKEND_UART_ASYNC default 1 help - Sets the number of bytes which can be buffered in RAM before log_output_flush - is automatically called on the backend. + 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"