From 5ee7b6caeba6b39ac0400c59ed9a16c0de316427 Mon Sep 17 00:00:00 2001 From: Yun Xu Date: Wed, 13 Sep 2017 10:35:34 -0700 Subject: [PATCH] fixing small issue --- sanic/app.py | 6 ++---- sanic/log.py | 7 ++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sanic/app.py b/sanic/app.py index 1d4497d0..f06e9cd4 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -570,7 +570,7 @@ class Sanic: def run(self, host=None, port=None, debug=False, ssl=None, sock=None, workers=1, protocol=None, backlog=100, stop_event=None, register_sys_signals=True, - access_log=True, log_config=None): + access_log=True): """Run the HTTP Server and listen until keyboard interrupt or term signal. On termination, drain connections before closing. @@ -588,7 +588,6 @@ class Sanic: :param protocol: Subclass of asyncio protocol class :return: Nothing """ - logging.config.dictConfig(log_config or LOGGING_CONFIG_DEFAULTS) if sock is None: host, port = host or "127.0.0.1", port or 8000 @@ -632,13 +631,12 @@ class Sanic: async def create_server(self, host=None, port=None, debug=False, ssl=None, sock=None, protocol=None, backlog=100, stop_event=None, - access_log=True, log_config=None): + access_log=True): """Asynchronous version of `run`. NOTE: This does not support multiprocessing and is not the preferred way to run a Sanic application. """ - logging.config.dictConfig(log_config or LOGGING_CONFIG_DEFAULTS) if sock is None: host, port = host or "127.0.0.1", port or 8000 diff --git a/sanic/log.py b/sanic/log.py index f9f96005..9c6d868d 100644 --- a/sanic/log.py +++ b/sanic/log.py @@ -1,4 +1,5 @@ import logging +import sys LOGGING_CONFIG_DEFAULTS = dict( @@ -28,17 +29,17 @@ LOGGING_CONFIG_DEFAULTS = dict( "console": { "class": "logging.StreamHandler", "formatter": "generic", - "stream": "sys.stdout" + "stream": sys.stdout }, "error_console": { "class": "logging.StreamHandler", "formatter": "generic", - "stream": "sys.stderr" + "stream": sys.stderr }, "access_console": { "class": "logging.StreamHandler", "formatter": "access", - "stream": "sys.stdout" + "stream": sys.stdout }, }, formatters={