def METHOD_NAME(logger):
    """
    A decorator that logs entry and exit points of the function it
    decorates. By default all function arguments and return values
    are logged.
    :param logger: The logger object that should be used
    """
    enter_str = "Entered function %s"
    exit_str = "Exited function %s"
    def _inner(func):
        @functools.wraps(func)
        def log_and_call(*args, **kwargs):
            # --------------------------------------------------------------
            extra = {
                "type": "function_enter",
                "function_name": func.__name__,
                "function_args": args,
                "function_kwargs": kwargs,
            }
            logger.debug(enter_str % func.__name__, extra=extra)
            # --------------------------------------------------------------
            returnvalue = func(*args, **kwargs)
            # --------------------------------------------------------------
            extra = {
                "type": "function_exit",
                "function_name": func.__name__,
                "function_returnvalue": returnvalue,
            }
            logger.debug(exit_str % func.__name__, extra=extra)
            # --------------------------------------------------------------
            return returnvalue
            # --------------------------------------------------------------
        return log_and_call
    return _inner