def METHOD_NAME():
    """
    Send logs to capsys instead of caplog.
    """
    formatter = logging.Formatter(
        fmt="[%(module)-16.16s] %(levelname)1.1s: %(message)s"
    )
    handler = logging.StreamHandler()
    handler.setFormatter(formatter)
    root = logging.getLogger()
    root.addHandler(handler)
    root.setLevel(logging.INFO)
    yield
    # Try to remove log directory if empty.
    logdir = Path("tests/logs")
    try:
        if logdir.exists():
            logdir.rmdir()
    except OSError as e:
        if ENOTEMPTY != e.errno:
            raise