[coreboot] r921 - coreboot-v3/lib

svn at coreboot.org svn at coreboot.org
Mon Oct 13 22:15:57 CEST 2008


Author: myles
Date: 2008-10-13 22:15:56 +0200 (Mon, 13 Oct 2008)
New Revision: 921

Modified:
   coreboot-v3/lib/Kconfig
   coreboot-v3/lib/console.c
Log:
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 at gmail.com>
Acked-by: Peter Stuge <peter at stuge.net>
Acked-by: Uwe Hermann <uwe at hermann-uwe.de>


Modified: coreboot-v3/lib/Kconfig
===================================================================
--- coreboot-v3/lib/Kconfig	2008-10-13 18:40:23 UTC (rev 920)
+++ coreboot-v3/lib/Kconfig	2008-10-13 20:15:56 UTC (rev 921)
@@ -68,6 +68,11 @@
 	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

Modified: coreboot-v3/lib/console.c
===================================================================
--- coreboot-v3/lib/console.c	2008-10-13 18:40:23 UTC (rev 920)
+++ coreboot-v3/lib/console.c	2008-10-13 20:15:56 UTC (rev 921)
@@ -132,12 +132,22 @@
 	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;





More information about the coreboot mailing list