def audit(func):
"""
Record a Flask route function in the audit log.
Generates a JSON record in the Flask log for every request.
"""
@wraps(func)
def wrapper(*args, **kwargs):
options = AuditOptions(
include_request_body=DEFAULT_INCLUDE_REQUEST_BODY,
include_response_body=DEFAULT_INCLUDE_RESPONSE_BODY,
include_path=True,
include_query_string=True,
)
with logging_levels():
return _audit_request(options, func, None, *args, **kwargs)
return wrapper
评论列表
文章目录