ipython_log.py¶
This module modifies an ipython
shell to log inputs, outputs, and
tracebacks to a custom logger.input
level. The INPUT
level is lower
than the DEBUG
level to avoid a terminal echo in debug mode.
- class hutch_python.ipython_log.IPythonLogger(ipython)¶
Class that logs the most recent inputs, outputs, and exceptions at the custom
INPUT
level.- Parameters
ipython (
ipython
Shell
) – The activeipython
Shell
, perhaps the one returned byIPython.get_ipython()
.
- hutch_python.ipython_log.load_ipython_extension(ipython)¶
Initialize the
IPythonLogger
.This involves adding the
INPUT
log level and registeringIPythonLogger.log
to run on thepost-execute
event.- Parameters
ip (
ipython
Shell
) – The activeipython
Shell
, perhaps the one returned byIPython.get_ipython()
.