Skip to content

Conversation

@magnumripper
Copy link
Member

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.

@magnumripper
Copy link
Member Author

I wasn't quite sure where to place WARN_ONCE macro. I put it in misc.h.

@magnumripper magnumripper force-pushed the warning-and-log-tweaks branch from adc9dc5 to de6d9d7 Compare November 17, 2025 07:25
@magnumripper
Copy link
Member Author

I will revert the log_event vs. log_event_ex thing. Since the callers are changed anyway when switching to the macro, the newline should just be dropped there instead.

@magnumripper magnumripper marked this pull request as draft November 17, 2025 07:35
@magnumripper magnumripper force-pushed the warning-and-log-tweaks branch from de6d9d7 to 04546d1 Compare November 17, 2025 21:05
@magnumripper
Copy link
Member Author

I will revert the log_event vs. log_event_ex thing. Since the callers are changed anyway when switching to the macro, the newline should just be dropped there instead.

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.

@magnumripper magnumripper force-pushed the warning-and-log-tweaks branch 6 times, most recently from 4b0a926 to f0a5684 Compare November 17, 2025 23:50
@magnumripper magnumripper removed the request for review from solardiz November 18, 2025 00:48
@magnumripper magnumripper force-pushed the warning-and-log-tweaks branch 2 times, most recently from 67a894d to 08cdb1f Compare November 18, 2025 07:49
magnumripper and others added 6 commits November 18, 2025 21:44
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.
@magnumripper magnumripper force-pushed the warning-and-log-tweaks branch from 08cdb1f to 908a43a Compare November 18, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant