-
Notifications
You must be signed in to change notification settings - Fork 361
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
Show colored messages in CMake output #2194
Show colored messages in CMake output #2194
Conversation
@med-ayssar , could you provide a bit more description? E.g. is it sensitive to non-terminal output? |
Can you elaborate more, what do you mean by non-terminal output. The functions calls responsible for outputing suchs messages are now called:
All function calls to message are then replaced by the corresponding message type. |
@med-ayssar: The description should always contain a summary of what this PR is about and why we would want it in NEST (similar to what your comment does). Both the description and the PR name should definitely mention that this relates to the The description might also benefit from an example screenshot contrasting the situation before/after the change. Also please use GitHub Flavored Markdown to highlight code like things as |
@med-ayssar: ping! |
b63adfc
to
2cbd6bb
Compare
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.
Thanks for the update. I have some minor suggestions and a less minor comment.
Pull request automatically marked stale! |
@med-ayssar: could you please have a look at my comments and finalize this? I really think it is a big improvement and should go in instead of sitting here stale and half-ready :-) |
I think I have replied to all your questions. Please have another look. |
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.
@med-ayssar: I just took the liberty to merge my suggestions into your branch 😁
@terhorstd: could you please especially look at differentiating between output to the shell and when redirected to files?
All common tools strip color codes when the output is not going to a terminal. I'm not sure how the CI handles the output, but all common highlighting seems to be still there so there is either additional highlighting, or trickery with pseudo-ttys. So I'd guess that the |
@med-ayssar Could you fix the conflicts that have come up? |
Due to the vacation of @terhorstd and that a) this is lying around for quite some time now, b) #2379 depends on it, and c) this is minor change that only affects the CMake output, I'm merging without the second review. Any (possible) problems with the rendering of output on the CI can be fixed in follow-up PRs. |
Changes:
message([<mode>])
with the correspondingprint
function, depending on themode
keyword.FATAL_ERROR
is mapped toprintError
function, outputting a red colored message.WARNING
is mapped toprintWarning
function, outputting a yellow colored message.STATUS
is mapped toprintInfo
function, outputting a green colored message.message
function without amode
is replaced by theprintInfo
function.print
function in ColorMessges can be used to extend new print functions with different colors.Before:
After:
First output lines:
Summary:
On Error: Setting
CMAKE_INSTALL_PREFIX
to an empty string!