Closed lilyball closed 3 years ago
How was this undiscovered for so long? :D
https://github.com/slog-rs/slog/blob/f9e30f0dd9bad610227d9374001fcc13d5b7c8c8/src/lib.rs#L422
this case needs to duplicated with , $($args:tt)*
part, just like other forms.
Care do crate a PR with a test + fix? :)
Oh, and slog_kv
https://github.com/slog-rs/slog/blob/f9e30f0dd9bad610227d9374001fcc13d5b7c8c8/src/lib.rs#L475 is supposed to be an exact copy of 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. :shrug:
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: