aboutsummaryrefslogtreecommitdiff
path: root/include/log.h
diff options
context:
space:
mode:
authorSimon Glass2021-01-20 20:10:53 -0700
committerTom Rini2021-03-12 17:41:35 -0500
commit9ad7a6c25c7142a46fe4b811c13bc3280c4bb27f (patch)
tree3ad69164919285a4f79ecd37355df16db6945f6a /include/log.h
parent79d5983b61e41d5c586489b03e75a75961d31041 (diff)
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>
Diffstat (limited to 'include/log.h')
-rw-r--r--include/log.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/log.h b/include/log.h
index da053b0a6e8..c0453d2f97c 100644
--- a/include/log.h
+++ b/include/log.h
@@ -326,6 +326,8 @@ void __assert_fail(const char *assertion, const char *file, unsigned int line,
enum log_rec_flags {
/** @LOGRECF_FORCE_DEBUG: Force output of debug record */
LOGRECF_FORCE_DEBUG = BIT(0),
+ /** @LOGRECF_CONT: Continuation of previous log record */
+ LOGRECF_CONT = BIT(1),
};
/**