-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open up the architecture #83
Comments
Does using the You can chain fern loggers with regular dispatch.chain(Box::new(logger) as Box<dyn log::Log>) If this works for your use case, I'd rather fix this by adding a new method to
But I don't think that overhaul should be necessary to allow extending things. The |
Not to say that I'd be against redoing this with an entirely trait-based approach, either, though! I think if we do turn trait Output: log::Log {
fn max_used_level(&self) -> log::LevelFilter;
} I'd imagine all the methods currently on the We could then remove a lot of code dealing with transforming things from I'm not likely to work on a refresh like this myself any time soon, but I'd definitely be open to changes implementing it - or something similar, if you've got different ideas for how we should restructure the crate. I just wanted to highlight in my earlier comment that I don't think the redesign is necessary in order to have extensibility - and in fact, we have a degree of extensibility right now. |
This. It mostly boils down to the question "how much more does
Gotcha. I can easily hack about everything on to every logging crate, but it quickly gets me to the point where a manual I'm currently thinking about throwing some time at this. What's this crate's stance on API-breaking changes, given that it hasn't hit 1.0 yet? |
We aren't at 1.0, but about 70% of the reason for that is that I definitely prefer keeping them to a minimum, but they're not out of the question. I guess - if it adds significant value, I'm willing to make a release, but outside of that I'd rather keep all updates backwards-compatible, and keep breaking changes in a separate branch to be released next time we need a new major version because of a new major If there are features this unblocks, or if it makes the API significantly nicer to use, I'd be willing to make a new major release for it. Otherwise, I'd be glad to have the changes on hand next time there's a reason for a major release, but I wouldn't make a release just for that. Right now I'm leaning towards this not being worth a major release? But that's mostly because in my eyes the biggest benefit is code clarity inside the codebase, and that's not something exposed very much to the average user. |
I'm trying to switch to using this crate from a more simple logger, and I ended up reading a lot of the internal code. I've noticed that every feature is part of a giant enum. This greatly restricts the ability to locally add new outputs or to customize existing ones, for example.
My suggestion is to factor out an interface into an
Output
trait.The text was updated successfully, but these errors were encountered: