-
-
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
Allow empty @logmsg #29672
Comments
ref #27650 |
This is an interesting use case; it's certainly not what I had in mind for One possibility would be to have something like @if_shouldlog Debug begin
@error "massive failure"
end |
Why not just a function like |
@tkf I think the logic should be as similar as possible to the macro versions, including passing any statically known metadata to |
Thanks for the clarification. I missed that |
This now works ( |
I was trying to use
@debug
like this:If
Debug
logging is enabled, I perform an expensive check. If the check is not true, the event should log as an error (I want to see the red color pop out in the middle of many logging messages). In this case, the@debug
itself should not log at all.However currently an empty
@logmsg
(with return value `nothing) produces an error:Would it be worthwhile to allow empty
@logmsg
to simply register no log message at all instead of throwing an error that doesn't seem to serve any purpose?The text was updated successfully, but these errors were encountered: