Drakulix / simplelog.rs

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

Unable to disable colored output with CombinedLogger #63

Closed ghost closed 3 years ago

ghost commented 3 years ago

Looking at the documentation I did not see an option to disable colored output with TermLogger, so I decided to attempt to disable the default features. I did not realize this would then disable the usage of TermLogger completely. I have an option in my program to also log to a file, not just the terminal, and CombinedLogger does not seem to allow combining of SimpleLogger and WriteLogger.

Is there a way to disable colored output while using a CombinedLogger? Currently in some cases the colors can become unreadable, for example the blue text in a default colored Powershell window since it has a blue background.

Drakulix commented 3 years ago

This is a good issue, because there should likely be a config option to disable coloring. BUT that said, combining a SimpleLogger and a WriteLogger should work, could you also tell me, exactly what kind of error you were running into??

ghost commented 3 years ago

I double checked and it does appear that SimpleLogger works with CombinedLogger, I wonder if I had a typo when I originally tried it. I believe it was a type mismatch but I can certainly open a new issue if I run into it again, as this crate works really well and I use it with most projects. That said, I think it might still be good to have an option for colors in case someone has a use for TermLogger but does not want color.

Drakulix commented 3 years ago

Should be fixed by #72