-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Some types don't have a slog::Value implementation and I've found this prevents me from using slog_derive as much as I'd like. Given it's not always possible to manually implement Value for a type, and that defeats a lot of the purpose behind custom derives anyway, it would be nice to have an "escape hatch" that lets you fall back to normal formatting machinery.
For example, you could add a #[slog(display)] attribute which will expand to something like ser.emit_arguments("key".into(), &format_args!("{}", self.value))?.
In the long term it'd be nice to add some sort of Value derive or even the ability to use arbitrary expressions which may themselves give you something implementing Value (e.g. #[slog(serialize = "$field.display()")]).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels