human
I wrote the below code

    calls = []
    def replacement(msg):
        calls.append(msg)
    logger = logging.getLogger(logger_name)
    orig = getattr(logger, log_level)
    setattr(logger, log_level, replacement)
    try:
        (yield calls)
    finally:
        setattr(logger, log_level, orig)

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

@contextmanager
def patch_logger(logger_name, log_level):