diff --git a/papermill/clientwrap.py b/papermill/clientwrap.py index f07f2582..e1670d82 100644 --- a/papermill/clientwrap.py +++ b/papermill/clientwrap.py @@ -32,7 +32,7 @@ def __init__(self, nb_man, km=None, log_cell=None, raise_on_iopub_timeout=True, """ super().__init__(nb_man.nb, km=km, raise_on_iopub_timeout=raise_on_iopub_timeout, **kw) self.nb_man = nb_man - self.log_cell = log_cell if log_cell is not None else kw['log'] + self.log_cell = log_cell if log_cell is not None else self.log def execute(self, **kwargs): """ diff --git a/papermill/log.py b/papermill/log.py index 3e26296b..6955ffce 100644 --- a/papermill/log.py +++ b/papermill/log.py @@ -8,7 +8,7 @@ not auto insert newline characters. """ -class CustomStreamHandler(logging.StreamHandler): +class NbOutputStreamHandler(logging.StreamHandler): def emit(self, record): try: msg = self.format(record) @@ -23,7 +23,7 @@ def emit(self, record): def _reconfigure_notebook_logger(l: logging.Logger): l.handlers = [] - custom_handler = CustomStreamHandler() + custom_handler = NbOutputStreamHandler() l.addHandler(custom_handler) formatter = logging.Formatter('%(message)s') custom_handler.setFormatter(formatter) diff --git a/papermill/tests/test_clientwrap.py b/papermill/tests/test_clientwrap.py index c5c8e6c8..bae477ed 100644 --- a/papermill/tests/test_clientwrap.py +++ b/papermill/tests/test_clientwrap.py @@ -1,6 +1,5 @@ import unittest from unittest.mock import call, patch -import logging import nbformat