Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize output formatting with latest Mbed OS #103

Merged
merged 1 commit into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default should be the one we had previously

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would make it different from the default in Mbed OS.

The main reason for this change, and to have the default be more visible, is to help our FAEs (and me) when our customers send us screenshots of their logs or do screen sharing during remote debug sessions, so we can actually read the debug output and help our customers.

"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