From 49aa74b83df51d2ae92d563663dd3d036bfd917f Mon Sep 17 00:00:00 2001 From: Marcus Chang Date: Wed, 12 May 2021 11:37:43 -0700 Subject: [PATCH] Synchronize output formatting with latest Mbed OS https://github.com/ARMmbed/mbed-os/pull/14576 --- mbed_lib.json | 9 +++++++-- source/mbed_trace.c | 7 +++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mbed_lib.json b/mbed_lib.json index cb1dadf..ba02753 100644 --- a/mbed_lib.json +++ b/mbed_lib.json @@ -14,7 +14,12 @@ "fea-ipv6": { "help": "Used to globally disable ipv6 tracing features.", "value": null + }, + "color-theme": { + "help": "Set color theme. 0 for readable, 1 for unobtrusive.", + "options": [0, 1], + "macro_name": "MBED_TRACE_COLOR_THEME", + "value": 0 } - - } + } } \ No newline at end of file diff --git a/source/mbed_trace.c b/source/mbed_trace.c index 20b1ca2..f085137 100644 --- a/source/mbed_trace.c +++ b/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