def METHOD_NAME(func):
    """A closure that logs the entry and exit of func using the logger."""
    if caller_name != "":
        name = caller_name
    elif hasattr(func, "im_func"):
        name = func.__func__.__name__
    else:
        name = func.__name__
    @wraps(func)
    def wrapper(*args, **kwargs):
        with Tracer(logger, level=level, msg=msg, determine_caller=False, caller_name=name):
            return func(*args, **kwargs)
    wrapper.__wrapped__ = func  # Emulate python 3 behavior of @wraps
    return wrapper