aws_lambda_decorators/decorators.py
def log(parameters=False, response=False):
    """
    Log parameters and/or response of the wrapped/decorated function using logging package

    Args:
        parameters: a flag indicating if the input parameters are to be logged
        response: a flag indicating if the returned response is to be logged
    """
    def decorator(func):
        def wrapper(*args, **kwargs):
            if parameters:
                LOGGER.info(PARAM_LOG_MESSAGE, func.__name__, args)
            func_response = func(*args, **kwargs)
            if response:
                LOGGER.info(RESPONSE_LOG_MESSAGE, func.__name__, func_response)
            return func_response
        return wrapper
    return decorator

    Log parameters and/or response of the wrapped/decorated function using logging package

    Args:
        parameters: a flag indicating if the input parameters are to be logged
        response: a flag indicating if the returned response is to be logged
    
Log parameters and/or response of the wrapped/decorated function using logging package
Log parameters and / or response of the wrapped / decorated function using logging package
def log(parameters=False, response=False):
    def decorator(func):
        def wrapper(*args, **kwargs):
            if parameters:
                LOGGER.info(PARAM_LOG_MESSAGE, func.__name__, args)
            func_response = func(*args, **kwargs)
            if response:
                LOGGER.info(RESPONSE_LOG_MESSAGE, func.__name__, func_response)
            return func_response
        return wrapper
    return decorator
def log ( parameters = False , response = False ) : def decorator ( func ) : def wrapper ( * args , ** kwargs ) : if parameters : LOGGER . info ( PARAM_LOG_MESSAGE , func . __name__ , args ) func_response = func ( * args , ** kwargs ) if response : LOGGER . info ( RESPONSE_LOG_MESSAGE , func . __name__ , func_response ) return func_response return wrapper return decorator
Log parameters and/or response of the wrapped/decorated function using logging package
Log parameters and / or response of the wrapped / decorated function using logging package
"""
    Log parameters and/or response of the wrapped/decorated function using logging package

    Args:
        parameters: a flag indicating if the input parameters are to be logged
        response: a flag indicating if the returned response is to be logged
    """
parameters
a flag indicating if the input parameters are to be logged
a flag indicating if the input parameters are to be logged
response
a flag indicating if the returned response is to be logged
a flag indicating if the returned response is to be logged