diff options
author | Michael Brown | 2016-01-12 16:35:06 +0100 |
---|---|---|
committer | Michael Brown | 2016-01-12 16:39:14 +0100 |
commit | 47dcd392dcd79d02eec2714696012785dd7a47c9 (patch) | |
tree | 897b26920043eb6975fe535572801ed8205da4d2 /src/core | |
parent | [i386] Add check_bios_interrupts() debug function (diff) | |
download | ipxe-47dcd392dcd79d02eec2714696012785dd7a47c9.tar.gz ipxe-47dcd392dcd79d02eec2714696012785dd7a47c9.tar.xz ipxe-47dcd392dcd79d02eec2714696012785dd7a47c9.zip |
[debug] Allow debug colourisation to be disabled
Some BIOS console redirection capabilities do not work well with the
colourised debug messages used by iPXE. We already allow the range of
colours to be controlled via the DBGCOL=... build parameter. Extend
this syntax to allow DBGCOL=0 to be used to mean "disable colours".
Requested-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/debug.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/debug.c b/src/core/debug.c index def5d8b0..9b2a823f 100644 --- a/src/core/debug.c +++ b/src/core/debug.c @@ -194,8 +194,12 @@ static int dbg_autocolour ( unsigned long stream ) { * @v stream Message stream ID */ void dbg_autocolourise ( unsigned long stream ) { - dbg_printf ( "\033[%dm", - ( stream ? ( DBGCOL_MIN + dbg_autocolour ( stream ) ) :0)); + + if ( DBGCOL_MIN ) { + dbg_printf ( "\033[%dm", + ( stream ? + ( DBGCOL_MIN + dbg_autocolour ( stream ) ) : 0)); + } } /** @@ -203,5 +207,7 @@ void dbg_autocolourise ( unsigned long stream ) { * */ void dbg_decolourise ( void ) { - dbg_printf ( "\033[0m" ); + + if ( DBGCOL_MIN ) + dbg_printf ( "\033[0m" ); } |