-
Notifications
You must be signed in to change notification settings - Fork 95
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
Macro key-value "err" => #e
syntax only works as the last argument
#289
Comments
How was this undiscovered for so long? :D Line 422 in f9e30f0
this case needs to duplicated with Care do crate a PR with a test + fix? :) |
Oh, and Line 475 in f9e30f0
kv (just with a different name in case of a collision), but I can already see they are differences.
These macros used to be much simpler, and don't really scale well as contributors add new cases. 🤷 |
Probably because the log macros don’t bother to document this feature, so most people are unlikely to be using it. I only found it by looking at ErrorValue, seeing the reference to this feature, and looked at the macro implementation to confirm. I am not able to write any PRs at this time. |
I'll try to look into it later today then. |
The slog macros support
"err" => #e
as shorthand for"err" => slog::ErrorValue(e)
. But for some reason adding any argument after this one triggers a parse error (when building, or a recursion limit error in rust-analyzer):This works:
As does this:
But this triggers the error:
The text was updated successfully, but these errors were encountered: