[feat] Add set_enable_paris_formatting() ConfigBuilder method to control whether… #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… 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.