Skip to content

Commit 6e4c02a

Browse files
author
Marcus Chang
committed
Trace: Change tr_debug color from gray to bright blue
The gray-on-black color code used for debug level print-out in mbed_trace is hard to read. Bright-blue-on-black increases the brightness of the text without over shadowing the info level default (white-on-black), thus making it easier to read while maintaining the original intention. For original color set MBED_TRACE_COLOR_THEME to 1.
1 parent 376fda5 commit 6e4c02a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

platform/mbed-trace/mbed_lib.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
"value": "malloc",
2020
"macro_name": "MEM_ALLOC"
2121
},
22+
"color-theme": {
23+
"help": "Set color theme. 0 for readable, 1 for unobtrusive.",
24+
"options": [0, 1],
25+
"macro_name": "MBED_TRACE_COLOR_THEME",
26+
"value": 0
27+
},
2228
"deallocator": {
2329
"value": "free",
2430
"macro_name": "MEM_FREE"

platform/mbed-trace/source/mbed_trace.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,17 @@
4949
#endif
5050
#endif /* YOTTA_CFG_MEMLIB */
5151

52+
#if defined(MBED_TRACE_COLOR_THEME) && (MBED_TRACE_COLOR_THEME == 1)
5253
#define VT100_COLOR_ERROR "\x1b[31m"
5354
#define VT100_COLOR_WARN "\x1b[33m"
5455
#define VT100_COLOR_INFO "\x1b[39m"
5556
#define VT100_COLOR_DEBUG "\x1b[90m"
57+
#else
58+
#define VT100_COLOR_ERROR "\x1b[31m"
59+
#define VT100_COLOR_WARN "\x1b[33m"
60+
#define VT100_COLOR_INFO "\x1b[39m"
61+
#define VT100_COLOR_DEBUG "\x1b[94m"
62+
#endif
5663

5764
/** default max trace line size in bytes */
5865
#ifdef MBED_TRACE_LINE_LENGTH

0 commit comments

Comments
 (0)