Skip to content

Conversation

@lionkor
Copy link
Owner

@lionkor lionkor commented Feb 3, 2025

When users of the library use \x1b[1;2m to make their output colorful, they end up with all of the extra control characters in their log if they use on_write as a logging mechanism.

This PR adds enable_ansi_escape_removal_on_write, which attempts to filter most/all of the ANSI escape codes it can find out of the output. This results in more allocations, but should be a minimal impact on normal use performance of this library.

@lionkor lionkor self-assigned this Feb 3, 2025
@lionkor lionkor force-pushed the ansi-escape-removal branch from 49fad8f to 02a8c46 Compare February 3, 2025 20:04
@lionkor lionkor force-pushed the ansi-escape-removal branch from 02a8c46 to 47a2d8d Compare February 3, 2025 20:05
@lionkor lionkor merged commit 78d244f into master Feb 3, 2025
6 of 7 checks passed
@lionkor lionkor deleted the ansi-escape-removal branch February 3, 2025 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants