mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
Add log levels to the output. In order to use this enable EXPERT and CONSOLE_LOG_LEVEL.
EXPERT seemed like the best fit. Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Peter Stuge <peter@stuge.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://coreboot.org/repository/coreboot-v3@921 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
e062cf6d54
commit
745f75457c
2 changed files with 16 additions and 1 deletions
|
@ -68,6 +68,11 @@ config CONSOLE
|
|||
help
|
||||
Support for various types of (debugging) consoles.
|
||||
|
||||
config CONSOLE_PREPEND_LOG_LEVEL
|
||||
boolean "Prepend log level to messages"
|
||||
default n
|
||||
depends CONSOLE && EXPERT
|
||||
|
||||
choice
|
||||
prompt "Console log level"
|
||||
default CONSOLE_LOGLEVEL_8
|
||||
|
|
|
@ -132,12 +132,22 @@ int printk(int msg_level, const char *fmt, ...)
|
|||
va_list args;
|
||||
int i;
|
||||
|
||||
#ifdef CONFIG_CONSOLE_PREPEND_LOG_LEVEL
|
||||
console_tx_byte('<', (void *)0);
|
||||
console_tx_byte(msg_level + '0', (void *)0);
|
||||
console_tx_byte('>', (void *)0);
|
||||
|
||||
i = 3;
|
||||
|
||||
if (msg_level > console_loglevel()) {
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
i = 0;
|
||||
#endif
|
||||
|
||||
va_start(args, fmt);
|
||||
i = vtxprintf(console_tx_byte, (void *)0, fmt, args);
|
||||
i += vtxprintf(console_tx_byte, (void *)0, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
return i;
|
||||
|
|
Loading…
Add table
Reference in a new issue