human
I wrote the below code

    @wraps(original)
    def logger(self, request, **routeArguments):
        logger = _get_logger(self)
        action = REQUEST(logger, request_path=request.path, method=request.method)
        incidentIdentifier = action.serialize_task_id()
        with action.context():
            d = DeferredContext(original(self, request, **routeArguments))
        def failure(reason):
            if reason.check(BadRequest):
                code = reason.value.code
                result = reason.value.result
            else:
                writeFailure(reason, logger, LOG_SYSTEM)
                code = INTERNAL_SERVER_ERROR
                result = incidentIdentifier
            request.setResponseCode(code)
            request.responseHeaders.setRawHeaders('content-type', ['application/json'])
            return dumps(result)
        d.addErrback(failure)
        d.addActionFinish()
        return d.result
    return logger

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def _logging(original):