summaryrefslogtreecommitdiff
path: root/common/log_console.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-06 01:33:00 +0300
committerSimon Glass <sjg@chromium.org>2021-07-21 19:27:35 +0300
commit72fa1ad8d9fe58153ca72e3886b8d846299e8fff (patch)
treea1979f905e8656a52b95a1a791626b48926999cc /common/log_console.c
parent96f37b092fdbb604e43c313265995d72ff1a82fe (diff)
downloadu-boot-72fa1ad8d9fe58153ca72e3886b8d846299e8fff.tar.xz
log: Allow padding of the function name
At present when function names are logged, the output is a little hard to read since every function is a different length. Add a way to pad the names so that the log messages line up vertically. This doesn't work if the function name is very long, but it makes a big difference in most cases. Use 20 characters as a default since this covers the vast majority of functions. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/log_console.c')
-rw-r--r--common/log_console.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/log_console.c b/common/log_console.c
index 3f6177499e..f1dcc04b97 100644
--- a/common/log_console.c
+++ b/common/log_console.c
@@ -38,7 +38,7 @@ static int log_console_emit(struct log_device *ldev, struct log_rec *rec)
if (fmt & BIT(LOGF_LINE))
printf("%d-", rec->line);
if (fmt & BIT(LOGF_FUNC))
- printf("%s()", rec->func);
+ printf("%*s()", CONFIG_LOGF_FUNC_PAD, rec->func);
}
if (fmt & BIT(LOGF_MSG))
printf("%s%s", add_space ? " " : "", rec->msg);