-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Warning and logging tweaks #5894
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
base: bleeding-jumbo
Are you sure you want to change the base?
Warning and logging tweaks #5894
Conversation
|
I wasn't quite sure where to place WARN_ONCE macro. I put it in misc.h. |
adc9dc5 to
de6d9d7
Compare
|
I will revert the |
de6d9d7 to
04546d1
Compare
Did so now, and putc the newline to stream after the fprintf_color of the message. Also added much more (modes, formats). This PR can stay draft for a while, I'll add more of the same. |
4b0a926 to
f0a5684
Compare
08cdb1f to
908a43a
Compare
68d423c to
cfc5efc
Compare
|
I am sure I missed things that would really benefit from color, we'll just have to add them later. |
7246737 to
ce48b18
Compare
|
@solardiz this is a pain to review but at least "core files", modes, shared OpenCL and formats are different commits and best reviewed one by one. Also, I'm not only sure you will request some changes right away but also that we'll both end up wanting to change other things later. It's more or less impossible to test all this by just running john - some notes/warnings doesn't pop up too often. I used color_notice for many messages starting with "Note:" and color_warning for nearly all starting with "Warning:" but there were a few "obvious" exceptions and we'll probably find out more over time. |
Add some function-like macros for log/warn/both WARN_AND_LOG() is like fprintf_color() then log_event(), with same message. WARN_ONCE() is like fprintf_color() but only once per session. LOG_ONCE() is like log_event() but only once per session. WARN_AND_LOG_ONCE() does both, with same message. Also add error color to error(), pexit() and similar stuff in misc.c
Also prefix log entries with "OpenCL:" for clarity.
ce48b18 to
9e5584d
Compare
Adds color to many warning/errors. This includes shared stuff such as BENCH_CLERROR and error() so we get more visibility to many problems.
Adds shared macros LOG_ONCE, WARN_ONCE and WARN_LOG_ONCE.
Drops obsolete dead code.