add Debug derive for OsLogger struct - #5
carl-wallace wants to merge 2 commits into
Conversation
…nto a manually constructed configuration using log4rs
simlay
left a comment
There was a problem hiding this comment.
I'm not affiliated with this repo but I watch. I don't like to just critique but I have some thoughts. I see why you might want to use the derivative crate but I would argue that derivative shouldn't be on by default or a sub-feature to logger. Part of my argument stems from that derivative hasn't been updated in 3 years. Then when using this crate you could enable derivative via oslog = { version = "*", features = ["logger", "derivative"] }
| #[derive(Derivative)] | ||
| #[derivative(Debug)] | ||
| pub struct OsLogger { | ||
| #[derivative(Debug = "ignore")] |
There was a problem hiding this comment.
I believe you can use a cfg_attr. ie: #[cfg_attr(derivative, derive(Derivative))].
There was a problem hiding this comment.
Thanks. Derivative was used solely because that is what decorates similar structs in log4rs. I should feature gated this but did not think about that until after. I will give your suggestions a try and add a feature.
This allows an instance of OsLogger to be factored into a manually constructed log4rs configuration so stdout or a file appender can be used alongside an appender for Apple's logging system