-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
logging: log: add LOG_WRN_ONCE
#70282
logging: log: add LOG_WRN_ONCE
#70282
Conversation
82086d9
to
22a4ee3
Compare
Add an equivalent to the linux `WARN_ONCE` macro. This is intended for use when the developer should be notified of an event, but may occur a multitude of times in quick succession. Using `LOG_WRN` could result in either cluttered logs or recursive logging (i.e. in serial drivers). Signed-off-by: Jordan Yates <[email protected]>
Add a test for the `LOG_WRN_ONCE` wrapper around `LOG_WRN`. Signed-off-by: Jordan Yates <[email protected]>
Document the existence of `LOG_WRN_ONCE`. Signed-off-by: Jordan Yates <[email protected]>
22a4ee3
to
915657d
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.
LGTM - I tossed around a similar rate-limit debug variant at one point.
Long time ago there was #41783 but author dropped it and it never get in. There we had |
I don't mind if that is the approach you want to go with, but I won't be resurrecting it. IMO only |
Add an equivalent to the linux
WARN_ONCE
macro. This is intended foruse when the developer should be notified of an event, but may occur a
multitude of times in quick succession.
Using
LOG_WRN
could result in either cluttered logs or recursivelogging (i.e. in serial drivers).
Proposed in the discussion of #65112