|
Debug Tools
|


Public Member Functions | |
| def | __init__ (self, stdout=False, ignoredefault=False) |
| def | closed (self) |
| def | __del__ (self) |
| def | clear (self, log=None) |
| def | flush (self) |
| def | writeboth (self, args, kwargs) |
| def | writethis (self, args, kwargs) |
| def | contents (self, date_regex="") |
| def | file_contents (self, log, date_regex="") |
| def | close (self) |
Public Attributes | |
| stdout_type | |
| write | |
Static Public Attributes | |
| def | write = writeboth |
How do I duplicate sys.stdout to a log file in python?
https://stackoverflow.com/questions/616645/how-do-i-duplicate-sys-stdout-to-a-log-file-in-python
Definition at line 47 of file std_capture.py.
| def __init__ | ( | self, | |
stdout = False, |
|||
ignoredefault = False |
|||
| ) |
If `ignoredefault` is True, only write to this object stream.
Definition at line 54 of file std_capture.py.
References TeeNoFile._contents, TeeNoFile._std_original, TeeNoFile.stdout_type, TeeNoFile.write, TeeNoFile.writeboth(), and TeeNoFile.writethis().

| def __del__ | ( | self | ) |
The try/except block is in case this is called at program exit time, when it's possible
that globals have already been deleted, and then the close() call might fail. Since
there's nothing we can do about such failures and they annoy the end users, we suppress
the traceback.
https://github.com/python/cpython/blob/1fd06f1eca80dcbf3a916133919482a8327f3da4/Lib/_pyio.py#L380
python Exception AttributeError: “'NoneType' object has no attribute 'var'”
https://stackoverflow.com/questions/9750308/python-exception-attributeerror-nonetype-object-has-no-attribute-var
Definition at line 83 of file std_capture.py.
References TeeNoFile.__closed, TeeNoFile._contents, TeeNoFile._process_contents(), TeeNoFile._std_original, TeeNoFile.close(), TeeNoFile.closed(), TeeNoFile.flush(), and TeeNoFile.stdout_type.

| def closed | ( | self | ) |
@return `True` if the file has been closed.
Definition at line 77 of file std_capture.py.
References TeeNoFile.__closed.
Referenced by TeeNoFile.__del__().
