You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, Sink has many methods beyond its fundamental semantics. If a downstream crate is going to implement a Sink type, a very large amount of boring boilerplate code needs to be written. This is a pain.
Inside spdlog-rs, we have a pretty dirty internal macro (common_impl!) to solve this problem. But since it's really, really, really dirty, I think it's best not to make this macro public and instead find a way to redesign the trait Sink.
Describe the solution you'd like
Maybe lighten Sink to just 2 methods log and flush, then move the other methods (should_log, level_filter, set_level_filter, set_formatter and set_error_handler) into a new public struct that will be a wrapper for a Sink. Maybe name the new struct SinkAdaptor? I still need to think it through.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently,
Sink
has many methods beyond its fundamental semantics. If a downstream crate is going to implement aSink
type, a very large amount of boring boilerplate code needs to be written. This is a pain.Inside
spdlog-rs
, we have a pretty dirty internal macro (common_impl!
) to solve this problem. But since it's really, really, really dirty, I think it's best not to make this macro public and instead find a way to redesign the traitSink
.Describe the solution you'd like
Maybe lighten
Sink
to just 2 methodslog
andflush
, then move the other methods (should_log
,level_filter
,set_level_filter
,set_formatter
andset_error_handler
) into a new public struct that will be a wrapper for aSink
. Maybe name the new structSinkAdaptor
? I still need to think it through.The text was updated successfully, but these errors were encountered: