toucan_data_sdk/utils/decorators.py
def log_time(logger):
    """
    Decorator to log the execution time of a function
    """
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            start = time.time()
            result = func(*args, **kwargs)
            end = time.time()
            _log_time(logger, func.__name__, start, end)
            return result
        return wrapper
    return decorator
def log_time(logger):
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            start = time.time()
            result = func(*args, **kwargs)
            end = time.time()
            _log_time(logger, func.__name__, start, end)
            return result
        return wrapper
    return decorator
def log_time ( logger ) : def decorator ( func ) : @ wraps ( func ) def wrapper ( * args , * * kwargs ) : start = time . time ( ) result = func ( * args , * * kwargs ) end = time . time ( ) _log_time ( logger , func . __name__ , start , end ) return result return wrapper return decorator
Decorator to log the execution time of a function
Decorator to log the execution time of a function