kedro does some things when it hooks logging that ...
# beginners-need-help
kedro does some things when it hooks logging that it shouldn't that messes up my setup for example, loading a hardcoded default config before initialization and loading my own logging.yml. This causes the loggers to print useless config messages with the wrong formatting for numexpr and kedro project dir message It's the same case with the rich pretty hook and the callbacks. I have to redo all the rich initialization on my file.
Copy code
from rich.traceback import install
from .progress import RICH_TRACEBACK_ARGS

# TODO: verify this works
# remove handlers added by the default config
logging.getLogger("kedro").handlers = []
logging.root.handlers = []
I also don't like how rich decides to use html elements for logging and formatting in jupyter, because it's clunky, larger (at least in vs code), and doesn't have a stable appearance when I commit my notebooks, so I need to run the following botch function after reload_kedro
Copy code
def _reconfigure_rich():
    from rich import reconfigure, _console

    _rich_console_args = {
        "width": PBAR_JUP_NCOLS,
        "height": 100,


    # Disable html rendering when using jupyter
    # force_jupyter=False messes with pretty print
    _console_check_buffer = _console._check_buffer

    def non_html_check_buffer(self):
        tmp = self.is_jupyter
        self.is_jupyter = False
        self.is_jupyter = tmp

    _console._check_buffer = non_html_check_buffer.__get__(_console)