borntyping / rust-simple_logger

A rust logger that prints all messages with a readable output format.
https://crates.io/crates/simple_logger
MIT License
221 stars 48 forks source link

Implement builder pattern #20

Closed creekorful closed 4 years ago

creekorful commented 4 years ago

Hello @borntyping this PR implements the builder pattern to instantiate the logger & rework the selective logging feature. (implementation idea by @piegamesde)

Do you want me to increment minor version (no breaking change introduce) on this PR?

Don't hesitate to correct me If there's a better way, or if you have better ideas.

borntyping commented 4 years ago

Yes - this should bump the major or minor version.

creekorful commented 4 years ago

Here's latest version with fixes & version bump :) Thanks for the comment & suggestions!

creekorful commented 4 years ago

@borntyping Should we mark as deprecated the 'old' instantiation methods or do you want to keep them in the futur?

borntyping commented 4 years ago

Happy to deprecate the old functions.

piegamesde commented 4 years ago

Thank you for the constructive discussion and for implementing this. I'll now go ahead and clean up that messy temporary logging setup in my projects …

creekorful commented 4 years ago

Thank you both for the great discussion & the code review, it was fun to implement the feature. I'm happy to have this functionality in simple_logger, IMO it's the best easiest logging library available and I didn't wanted to move on something else.

Cheers!