Drakulix / simplelog.rs

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

paris should respect "set_write_log_enable_colors" #98

Closed jb-alvarado closed 1 year ago

jb-alvarado commented 2 years ago

Hi, thanks for all your effort in this nice project!

As you can read in the title I would suggest, that the paris feature, for coloring text with html tags, should respect the setting set_write_log_enable_colors(false). I think at the moment it is a bit inconsistent and it is not always useful to have them on.

Drakulix commented 2 years ago

Hey, thanks for the input! Unfortunately this is not something simplelog can easily provide, because it has no control over what exactly paris returns. To facilitate this kind of feature simplelog would have to manually remove color control codes from the logging output again. This is better solved by adding a global toggle to the paris-crate, which then could also be set by simplelog's set_write_log_enable_colors.

jb-alvarado commented 2 years ago

Thank you for your answer! I understand.

I wrote a feature request on paris.

jb-alvarado commented 2 years ago

@Drakulix, I got this reply:

I could add a new method that accepts a flag that tells it to only remove the tags and not replace them with ANSI codes although > that's kind of as far as I can take it. Handling whether or not that flag should be true or false needs to be done in the simplelog crate. Would that be enough for you guys?

Is that ok for you?

Drakulix commented 2 years ago

I answered directly on the paris issue. :) Thanks for reaching out!