mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 11:24:42 +00:00
log: Support outputing function names in SPL
The output is garbled when tiny printf() is used. Correct this by adding a special case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
dac1fa5c19
commit
f9ebfd7c7a
1 changed files with 8 additions and 2 deletions
|
@ -37,8 +37,14 @@ static int log_console_emit(struct log_device *ldev, struct log_rec *rec)
|
||||||
printf("%s:", rec->file);
|
printf("%s:", rec->file);
|
||||||
if (fmt & BIT(LOGF_LINE))
|
if (fmt & BIT(LOGF_LINE))
|
||||||
printf("%d-", rec->line);
|
printf("%d-", rec->line);
|
||||||
if (fmt & BIT(LOGF_FUNC))
|
if (fmt & BIT(LOGF_FUNC)) {
|
||||||
printf("%*s()", CONFIG_LOGF_FUNC_PAD, rec->func);
|
if (CONFIG_IS_ENABLED(USE_TINY_PRINTF)) {
|
||||||
|
printf("%s()", rec->func);
|
||||||
|
} else {
|
||||||
|
printf("%*s()", CONFIG_LOGF_FUNC_PAD,
|
||||||
|
rec->func);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (fmt & BIT(LOGF_MSG))
|
if (fmt & BIT(LOGF_MSG))
|
||||||
printf("%s%s", add_space ? " " : "", rec->msg);
|
printf("%s%s", add_space ? " " : "", rec->msg);
|
||||||
|
|
Loading…
Add table
Reference in a new issue