-
Notifications
You must be signed in to change notification settings - Fork 3k
Colorized the short Warnings/Errors generated by the toolchains #2122
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
Conversation
@theotherjimmy Don't like the colorama dependency in utils.py. Why not handle notify function/output and colorize from there? |
I could. I assumed that it could be a more general purpose colorization function and used in more than just the toolchains. |
Don't merge yet. New implementation coming. |
Implementation will be: add option to options.py to add colorization; use that option to replace the notification function within the toolchains through the constructor. |
935c899
to
2279bda
Compare
The implementation is much better now, but still changes something in |
43d3ed5
to
ea9ff9f
Compare
|
||
import sys | ||
import re | ||
from colorama import init |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that @screamerbg had some issues with colorama at some point. @screamerbg, is that still the case?
What did you test this on? Doesn't work in my Linux console, the ANSI escapes don't seem to work:
My TERM is set to |
...and the same thing happens in Windows (cmd.exe). 👎 |
@bogdanm: I tested it Xterm ( |
@theotherjimmy Would you be so kind and add meaningful description to this PR ? See here |
@PrzemekWirkus Thank you for the friendly reminder. Please find a description of what this PR adds to our tools in the first comment. |
should be picked up by most cli's
3b476ea
to
e2c8837
Compare
Thanks, Jimmy. @bogdanm can you confirm that the latest version works for you? |
Linux: it works partially. Warnings like the one below are shown in the proper color:
Errors are more problematic. For the error below:
the first 4 lines are properly colorized, the others are shown in the regular color. Also, I have a linker error that's not being colorized at all. I don't consider any of the above to be a blocker for merging this PR. We can improve it later. |
I can see the exact same behaviour in Windows, which is a good thing. |
@bogdanm, Yep, only the short form of the Warnings/Errors are colorized at the moment. It should be possible to build on this PR to make a more complete colorization in the future. |
These commits add colorization to all of the short form Warning and Error messages generated by the compiler when the --color switch is provided on the command line. The default colorization will make Warnings Yellow and Errors Red, but can be changed by the user, in
mbed_settings.py
if they find yellow and red unreadable or ugly.Affects these top level scripts:
build.py
make.py
test.py
Therefore the mbed subcommands compile, and test are also affected.