shell: Improve handling of log messages

If burst of log messages was passed to the shell log
backend, it was likely that messages were lost because
shell had no means to control arrivals of log messages.

Added log message enqueueing timeout to the shell instance
to allow blocking logger thread if short-term arrival rate
exceeded shell capabilities.

Added kconfig option for setting log message queue size
and timeout in RTT and UART instances. Added section in
shell documentation which explains interaction between
the logger and shell instance acting as a logger backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2018-12-17 10:43:58 +01:00 committed by Carles Cufí
commit 08f0d93cbb
10 changed files with 87 additions and 20 deletions

View file

@ -0,0 +1,10 @@
config $(module)_LOG_MESSAGE_QUEUE_TIMEOUT
int "Log message drop timeout (in milliseconds)"
default $(default-timeout)
range -1 10000
help
If queue with pending log messages is full, oldest log message is
dropped if queue is still full after requested time (-1 is forever).
Logger thread is blocked for that period, thus long timeout impacts
other logger backends and must be used with care.