def logging_middleware_factory(app: web.Application, handler: Any) -> Callable:
"""Basic logging and accounting."""
async def middleware_handler(request: web.Request) -> web.Response:
stats.inc('num_calls', 'WEBAPI')
log.msg('Received request: %s' % request, 'WEBAPI')
return await handler(request)
return middleware_handler
评论列表
文章目录