def METHOD_NAME(*args, **kwds):
    """
    Wrap the function in log entries. The entry of the function and
    the exit of the function is logged using the DEBUG log level.
    If the logger does not log DEBUG messages, this just returns
    the result of ``func(*args, **kwds)`` to improve performance.
    :param args: The positional arguments starting with index
    :type args: tuple
    :param kwds: The keyword arguments
    :type kwds: dict
    :return: The wrapped function
    """
    # Exit early if self.logger disregards DEBUG messages.
    if not self.logger.isEnabledFor(logging.DEBUG):
        return func(*args, **kwds)
    log_args = args
    log_kwds = kwds
    if self.hide_args or self.hide_kwargs or \
            self.hide_args_keywords:
        try:
            level = self.logger.getEffectiveLevel()
            # Check if we should not do the password logging.
            # I.e. we only do password logging if log_level < 10.
            if level != 0 and level >= 10:
                # Hide specific arguments or keyword arguments
                log_args = list(deepcopy(args))
                log_kwds = deepcopy(kwds)
                for arg_index in self.hide_args:
                    log_args[arg_index] = "HIDDEN"
                for keyword in self.hide_kwargs:
                    log_kwds[keyword] = "HIDDEN"
                for k, v in self.hide_args_keywords.items():
                    for keyword in v:
                        if keyword in args[k]:
                            log_args[k][keyword] = "HIDDEN"
        except Exception:
            # Probably the deepcopy fails, due to special objects in the
            # args But as we are asked to hide a parameter, we hide
            # them all!
            log_args = ()
            log_kwds = {}
    try:
        if self.log_entry:
            self.logger.debug(self.ENTRY_MESSAGE.format(
                func.__name__, log_args, log_kwds))
        else:
            self.logger.debug(self.ENTRY_MESSAGE.format(
                func.__name__, "HIDDEN", "HIDDEN"))
    except Exception as exx:
        self.logger.error(exx)
        self.logger.error("Error during logging of function {0}! {1}".format(func.__name__, exx))
    f_result = func(*args, **kwds)
    try:
        if self.log_exit:
            self.logger.debug(self.EXIT_MESSAGE.format(func.__name__, f_result))
        else:
            self.logger.debug(self.EXIT_MESSAGE.format(func.__name__, "HIDDEN"))
    except Exception as exx:
        self.logger.error("Error during logging of function {0}! {1}".format(func.__name__, exx))
    return f_result