log: Handle line continuation
authorSimon Glass <sjg@chromium.org>
Thu, 21 Jan 2021 03:10:53 +0000 (20:10 -0700)
committerTom Rini <trini@konsulko.com>
Fri, 12 Mar 2021 22:41:35 +0000 (17:41 -0500)
commit9ad7a6c25c7142a46fe4b811c13bc3280c4bb27f
tree3ad69164919285a4f79ecd37355df16db6945f6a
parent79d5983b61e41d5c586489b03e75a75961d31041
log: Handle line continuation

When multiple log() calls are used which don't end in newline, the
log prefix is prepended multiple times in the same line. This makes the
output look strange.

Fix this by detecting when the previous log record did not end in newline.
In that case, setting a flag.

Drop the unused BUFFSIZE in the test while we are here.

As an example implementation, update log_console to check the flag and
produce the expected output.

Signed-off-by: Simon Glass <sjg@chromium.org>
common/log.c
common/log_console.c
doc/develop/logging.rst
include/asm-generic/global_data.h
include/log.h
test/log/cont_test.c