[riot-notifications] [RIOT-OS/RIOT] sys/log: add module for colorized logging (#11573)

Alexandre Abadie notifications at github.com
Mon May 27 15:38:25 CEST 2019


aabadie commented on this pull request.



> +    va_start(args, format);
+    /* Temporarily disable clang format-nonliteral warning */
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wformat-nonliteral"
+#endif /* clang */
+    vprintf(format, args);
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif /* clang */
+    va_end(args);
+    printf(LOG_RESET_ANSI_COLOR_CODE);
+
+#ifdef MODULE_NEWLIB
+    /* no fflush on msp430 */
+    fflush(stdout);

To force the reset escape code to be printed, otherwise, when one exits the terminal (pyterm or socat or miniterm.py) the last color code still applies and this messes up the host terminal.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11573#discussion_r287794279
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190527/492cae04/attachment.html>


More information about the notifications mailing list