def METHOD_NAME(level: int, filename: str, lineo: int, msg: str):
    if level < 0:  # clear the output in notebook / console
        from IPython.display import (  # type: ignore # pylint: disable=import-outside-toplevel
            clear_output,
        )
        clear_output(wait=True)
    else:
        level2log[level](f"[{os.path.basename(filename)}:{lineo}] " + msg)