fix original code logic

This commit is contained in:
zenix 2017-04-12 18:52:01 +09:00
parent 66923bc0e3
commit c5f137c715

View File

@ -31,9 +31,9 @@ class Sanic:
log_config=DEFAULT_LOG_CONF): log_config=DEFAULT_LOG_CONF):
if log_config: if log_config:
logging.config.dictConfig(log_config) logging.config.dictConfig(log_config)
else: # Only set up a default log handler if the
# Only set up a default log handler if the # end-user application didn't set anything up.
# end-user application didn't set anything up. if not logging.root.handlers and log.level == logging.NOTSET:
formatter = logging.Formatter( formatter = logging.Formatter(
"%(asctime)s: %(levelname)s: %(message)s") "%(asctime)s: %(levelname)s: %(message)s")
handler = logging.StreamHandler() handler = logging.StreamHandler()
@ -448,6 +448,7 @@ class Sanic:
# -------------------------------------------- # # -------------------------------------------- #
# Request Middleware # Request Middleware
# -------------------------------------------- # # -------------------------------------------- #
request.app = self request.app = self
response = await self._run_request_middleware(request) response = await self._run_request_middleware(request)
# No middleware results # No middleware results