Belle II Software development
|
Public Member Functions | |
def | __init__ (self, out, replacements) |
def | write (self, data) |
def | __getattr__ (self, name) |
Protected 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.
|
protected |
where to forward output
Definition at line 28 of file logfilter.py.
|
protected |
build a regular expression from dictionary keys
Definition at line 32 of file logfilter.py.
|
protected |
what to replace
Definition at line 30 of file logfilter.py.