Skip to content

Commit

Permalink
Synchronize output formatting with latest Mbed OS
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Chang authored and Marcus Chang committed Jul 22, 2021
1 parent e99f212 commit 49aa74b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

}
}
}
7 changes: 7 additions & 0 deletions source/mbed_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49aa74b

Please sign in to comment.