def time_logger(func):
    """
    Decorator to log the execution time of a function.

    Args:
        func (callable): The function whose execution time is to be logged.

    Returns:
        callable: The wrapper function that logs the execution time of the original function.
    """

    def wrapper(*args, **kwargs):
        start_time = time.time()
        result = func(*args, **kwargs)
        end_time = time.time()
        Logger.get_logger().debug(
            f"Function {func.__name__} took {end_time - start_time} seconds to execute"
        )
        return result

    return wrapper
Decorator to log the execution time of a function.

Args:
func (callable): The function whose execution time is to be logged.

Returns:
callable: The wrapper function that logs the execution time of the original function.
preprocessors/Emilia/utils/logger.py