![]() |
Belle II Software
release-08-02-04
|
Public Member Functions | |
| def | __init__ (self, out, replacements) |
| def | write (self, data) |
| def | __getattr__ (self, name) |
Private Attributes | |
| _out | |
| where to forward output | |
| _replacements | |
| what to replace | |
| _regex | |
| build a regular expression from dictionary keys | |
Simple class to intercept anything written to python stdout and replace a given set of strings with placehholders to improve reproducibility.
Definition at line 14 of file logfilter.py.
| def __init__ | ( | self, | |
| out, | |||
| replacements | |||
| ) |
Setup the forwarding and replacements
Parameters:
out (file object): Where to forward the output too
replacements (dict(str, str)): Dictionary of strings and their replacements
Definition at line 20 of file logfilter.py.
| def __getattr__ | ( | self, | |
| name | |||
| ) |
Forward all other methods from the out stream
Definition at line 39 of file logfilter.py.
| def write | ( | self, | |
| data | |||
| ) |
Check all messages for strings to replace
Definition at line 34 of file logfilter.py.