Public Member Functions | |
| __init__ (self, fd=1, dest=sys.stderr, encoding="utf-8", errors="strict") | |
| finish (self) | |
Protected Attributes | |
| _fd = fd | |
| _dest = dest | |
| _filehandle = os.dup(fd) | |
| _thread = threading.Thread(target=consumer_thread, args=(pipe_read, dest)) | |
Redirect a logging file descriptor to a Python stream.
Parameters
----------
fd : `int`
File descriptor number, usually 1 for standard out, the default log
output location.
dest : `io.TextIOBase`
Destination text stream, often `sys.stderr` for ipython or Jupyter
notebooks.
encoding : `str`
Text encoding of the data written to fd.
errors : `str`
Encoding error handling.
Notes
-----
Inspired by `this Stack Overflow answer
<https://stackoverflow.com/questions/41216215>`_
| lsst.log.utils.LogRedirect.finish | ( | self | ) |
Stop redirecting output.