Closed shimaowo closed 1 year ago
@Drakulix So the tests fail this way even in master, due to the discrepancy between how the log import is handled. I could try to address that here, but it's kind of orthogonal.
Actually this is easier to fix with this changeset than it is in master, because paris no longer requires special handling.
This PR will go through one of these days!
… a given logger uses or strips paris formatting. Only available with the paris feature, defaults to enabled for backwards compatibility. Fixes #98 and #112
This basically just defers the paris formatting until actual log time, rather than having it applied as part of the initial macro. This allows specifying different values per-logger (via their Config), which can then be passed to the new paris method.
paris_macros was removed as it is no longer used.
I chose to add a new flag, rather than use write_log_enable_colors, as the setter for that is already gated by the ansi_term feature, and presumably already has a use.
The extra 'return' is due to rust not understanding that a terminating statement is an implicit return if there is a later #[cfg] block.
I did not include a test as there are no paris tests currently.
Simple example:
The TermLogger output will be colored as usual; the WriteLogger output will simply be the message "Here is some colored text." with no markup or formatting.