-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Don't log nothing. #27650
Don't log nothing. #27650
Conversation
An alternative would be having a |
Yeah sure, I wanted to keep the API simple and |
#27352 is possibly related, discussing the printing of |
Sorry I haven't been responsive on this — I generally don't have time to keep up with all the activity in JuliaLang/julia so I often miss things. You can ping me though ;-) Does something like the alternative over at #29672 make sense? I think we could probably factor apart the early log checks so that they're usable independently of the log sinking part of the interface. |
Yeah sure, the |
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.
This is stale, but still seems reasonable to me, if you want to revive it (or perhaps "missing" would be the more canonical?)
My opinion would be to require !(msg === nothing || isempty(kwargs))
to skip generating a log entry
The logging macros support a very useful block-like syntax where the body builds and returns the message to log, making it easy to conditionalize complex or expensive message building code:
Meanwhile, some C APIs have additional log buffer or log level arguments, and as such need some log-conditional set-up that does not immediately produce a message. One solution would be for the logging macros to ignore
nothing
messages, enabling the following paradigm (taken from CUDAdrv.jl):An alternative solution would be to query the log level of the active logger, but that could be complex (which logger, env flag overrides, ...). This seemed like a DRY solution. Thoughts?