1.1.4.1.3. test_automation.utils.logfiltering
Module to remove all extra and unnecessary characters from log files.
1.1.4.1.3.1. Attributes
1.1.4.1.3.2. Classes
A wrapper that strips ANSI/control sequences before writing. |
1.1.4.1.3.3. Functions
|
Removes ANSI escape codes, orphan CSI sequences, and stray control |
1.1.4.1.3.4. Module Contents
- test_automation.utils.logfiltering.strip_ansi_and_controls(text)[source]
Removes ANSI escape codes, orphan CSI sequences, and stray control characters.
- Parameters:
text (str) – Raw string to clean.
- Returns:
Cleaned string without ANSI/control sequences.
- Return type:
str
- class test_automation.utils.logfiltering.AnsiStrippingStream(underlying)[source]
A wrapper that strips ANSI/control sequences before writing.
This is typically used to wrap a file handle so that all log writes are cleaned of terminal formatting characters automatically.
- Parameters:
underlying (TextIO)