aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/console/Kconfig9
-rw-r--r--src/console/printk.c3
2 files changed, 11 insertions, 1 deletions
diff --git a/src/console/Kconfig b/src/console/Kconfig
index 37d8fefe96..6152592637 100644
--- a/src/console/Kconfig
+++ b/src/console/Kconfig
@@ -395,6 +395,15 @@ config DEFAULT_CONSOLE_LOGLEVEL
endif
+config CONSOLE_USE_LOGLEVEL_PREFIX
+ bool "Use loglevel prefix to indicate line loglevel"
+ default y
+ help
+ When enabled, if the code contains a:
+ `printk(BIOS_DEBUG, "This is a debug message!\n")`,
+ it will show up as:
+ `[DEBUG] This is a debug message!`
+
config CONSOLE_USE_ANSI_ESCAPES
bool "Use ANSI escape sequences for console highlighting"
default y
diff --git a/src/console/printk.c b/src/console/printk.c
index eb35c53f22..1ce2fad55f 100644
--- a/src/console/printk.c
+++ b/src/console/printk.c
@@ -96,7 +96,8 @@ static void line_start(union log_state state)
and potentially an escape sequence for highlighting. */
if (CONFIG(CONSOLE_USE_ANSI_ESCAPES))
wrap_interactive_printf(BIOS_LOG_ESCAPE_PATTERN, bios_log_escape[state.level]);
- wrap_interactive_printf(BIOS_LOG_PREFIX_PATTERN, bios_log_prefix[state.level]);
+ if (CONFIG(CONSOLE_USE_LOGLEVEL_PREFIX))
+ wrap_interactive_printf(BIOS_LOG_PREFIX_PATTERN, bios_log_prefix[state.level]);
}
static void line_end(union log_state state)