Drakulix / simplelog.rs

Simple Logging Facility for Rust
https://docs.rs/simplelog/
Apache License 2.0
439 stars 73 forks source link

Add possibility to configure via environment variables. #34

Closed PieterPenninckx closed 5 years ago

PieterPenninckx commented 5 years ago

Would you be open to the possibility to configure simplelog based on environment variables (like in https://github.com/resamplr/rsynth/blob/9787b615098e815ee84ba6842948e5ee14db90c1/examples/test_synth.rs#L165-L213)? I can prepare a pull request for that, I just wanted to check if this is something that can be in scope of this crate.

Drakulix commented 5 years ago

Sorry for my (really) late answer. I am not in favor of adding this directly to the simplelog codebase. I feel this adds more complexity and can be implemented by the user themselves (like you are showing).

But I would happily accept a PR with a new example showing how you may do this, if you have the time.

PieterPenninckx commented 5 years ago

No problem. For real-time audio programming, we will probably need to solve another problem first anyway. (How to log without memory allocation in the realtime thread, but that's definitely out of scope for simplelog.)