Commit 6cdf50c
authored
Reset ANSI colors to default before newline (#556)
UART output is printed in color as follows:
AVR_LOG(avr, LOG_OUTPUT, FONT_GREEN "%s\n" FONT_DEFAULT, ...);
Trace and error messages are formatted similarly, with FONT_DEFAULT
following the newline. As these messages go to stdout, which defaults to
being line-buffered, the FONT_DEFAULT ANSI escape code is not output to
the terminal right away, and stays in the stdout output buffer. If this
is followed by a message printed to stderr, which is unbuffered, that
second message will be unduly colored.
Fix this by sending FONT_DEFAULT before the newline. While we are at it,
remove a stray FONT_DEFAULT from a LOG_WARNING uncolored message.1 parent 7aaf8a6 commit 6cdf50c
3 files changed
+8
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
| 223 | + | |
225 | 224 | | |
226 | 225 | | |
227 | 226 | | |
| |||
233 | 232 | | |
234 | 233 | | |
235 | 234 | | |
236 | | - | |
| 235 | + | |
237 | 236 | | |
238 | 237 | | |
239 | 238 | | |
| |||
252 | 251 | | |
253 | 252 | | |
254 | 253 | | |
255 | | - | |
256 | | - | |
| 254 | + | |
257 | 255 | | |
258 | 256 | | |
259 | 257 | | |
| |||
464 | 462 | | |
465 | 463 | | |
466 | 464 | | |
467 | | - | |
| 465 | + | |
468 | 466 | | |
469 | 467 | | |
470 | 468 | | |
471 | 469 | | |
472 | 470 | | |
473 | | - | |
| 471 | + | |
474 | 472 | | |
475 | 473 | | |
476 | 474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
0 commit comments