diff --git a/platform/mbed-trace/mbed_lib.json b/platform/mbed-trace/mbed_lib.json index f58ccb2..9c27f4f 100644 --- a/platform/mbed-trace/mbed_lib.json +++ b/platform/mbed-trace/mbed_lib.json @@ -19,6 +19,12 @@ "value": "malloc", "macro_name": "MEM_ALLOC" }, + "color-theme": { + "help": "Set color theme. 0 for readable, 1 for unobtrusive.", + "options": [0, 1], + "macro_name": "MBED_TRACE_COLOR_THEME", + "value": 0 + }, "deallocator": { "value": "free", "macro_name": "MEM_FREE" diff --git a/platform/mbed-trace/source/mbed_trace.c b/platform/mbed-trace/source/mbed_trace.c index eba23ef..4e1f16a 100644 --- a/platform/mbed-trace/source/mbed_trace.c +++ b/platform/mbed-trace/source/mbed_trace.c @@ -49,10 +49,17 @@ #endif #endif /* YOTTA_CFG_MEMLIB */ +#if defined(MBED_TRACE_COLOR_THEME) && (MBED_TRACE_COLOR_THEME == 1) #define VT100_COLOR_ERROR "\x1b[31m" #define VT100_COLOR_WARN "\x1b[33m" #define VT100_COLOR_INFO "\x1b[39m" #define VT100_COLOR_DEBUG "\x1b[90m" +#else +#define VT100_COLOR_ERROR "\x1b[31m" +#define VT100_COLOR_WARN "\x1b[33m" +#define VT100_COLOR_INFO "\x1b[39m" +#define VT100_COLOR_DEBUG "\x1b[94m" +#endif /** default max trace line size in bytes */ #ifdef MBED_TRACE_LINE_LENGTH