summaryrefslogtreecommitdiff
path: root/common/log.c
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2020-11-27 11:20:54 +0100
committerTom Rini <trini@konsulko.com>2021-01-15 14:36:11 -0500
commitdd500134a4201f0edd8a8f6b9618ed7094b8d29e (patch)
tree13375c3746f034584f278520c92508d22c7b637b /common/log.c
parentce9af2a6b57b512853d6e6234616edc4265669de (diff)
log: use console puts to output trace before LOG init
Use the console puts functions to output the traces before the log initialization (when CONFIG_LOG is not activated). This patch allows to display the first U-Boot traces (with macro debug) when CONFIG_DEBUG_UART is activated and not only drop them. For example for traces in board_f.c requested by the macro debug, when LOG_DEBUG is defined and CONFIG_LOG is activated. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'common/log.c')
-rw-r--r--common/log.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/log.c b/common/log.c
index 212789d6b3..a4ed7d79f8 100644
--- a/common/log.c
+++ b/common/log.c
@@ -246,6 +246,15 @@ int _log(enum log_category_t cat, enum log_level_t level, const char *file,
if (!(gd->flags & GD_FLG_LOG_READY)) {
gd->log_drop_count++;
+
+ /* display dropped traces with console puts and DEBUG_UART */
+ if (rec.level <= CONFIG_LOG_DEFAULT_LEVEL || rec.force_debug) {
+ va_start(args, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, args);
+ puts(buf);
+ va_end(args);
+ }
+
return -ENOSYS;
}
va_start(args, fmt);