add log crate adapter behind feature flag#4
Conversation
Signed-off-by: Antonio Souza <arfs.antonio@gmail.com>
Signed-off-by: Antonio Souza <arfs.antonio@gmail.com>
Signed-off-by: Antonio Souza <arfs.antonio@gmail.com>
MOZGIII
left a comment
There was a problem hiding this comment.
The feature flags are dinitely a way to go here, unless you want to split into multiple crates and let the user combine fully abstracted pieces together themselves.
For a batteries included solution what I think project aims to be - this seems like good fit.
Not a big fan of the API call you have to make; better make it be included at new() somehow, or simiar; like how when a type provides a builder interface with something like A::builder().with_a().with_b().build() and A::new() is just a shorthand for A::builder().build(); in this case, however, one would have to different names, since both builder and new don't assume any side effects like initialization. But the different naming with a similar stricture could bring a simple and unified API that doesn't have this property of unsymmetic setup for adapter vs non-adapater setting.
Thanks for the review! |
Description
log::Logtrait forLoggerso sheen can act as a backend for thelogfacadelog::info!(),log::warn!(), etc. gets routed through sheen's formatterslogfeature flag (sheen = { features = ["log"] })Type of Change
Checklist
cargo fmtrancargo clippypassescargo testpassesCloses #3 (partial)