From 3b2fb6f78e7bbee887663cb64e81e735b09134ee Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Fri, 2 Feb 2018 20:07:39 -0800 Subject: [PATCH] Use loggers rather then the logging module directly Refs django/channels#846 --- daphne/http_protocol.py | 2 +- daphne/server.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/daphne/http_protocol.py b/daphne/http_protocol.py index 2b93133..40694c0 100755 --- a/daphne/http_protocol.py +++ b/daphne/http_protocol.py @@ -221,7 +221,7 @@ class WebRequest(http.Request): "size": self.sentLength, }) except Exception as e: - logging.error(traceback.format_exc()) + logger.error(traceback.format_exc()) else: logger.debug("HTTP response chunk for %s", self.client_addr) else: diff --git a/daphne/server.py b/daphne/server.py index 1488114..7cdd61e 100755 --- a/daphne/server.py +++ b/daphne/server.py @@ -189,7 +189,7 @@ class Server(object): # Protocol is asking the server to exit (likely during test) self.stop() else: - logging.error( + logger.error( "Exception inside application: {}\n{}{}".format( exception, "".join(traceback.format_tb( @@ -216,7 +216,7 @@ class Server(object): if not application_instance.done(): application_instance.cancel() wait_for.append(application_instance) - logging.info("Killed %i pending application instances", len(wait_for)) + logger.info("Killed %i pending application instances", len(wait_for)) # Make Twisted wait until they're all dead wait_deferred = defer.Deferred.fromFuture(asyncio.gather(*wait_for)) wait_deferred.addErrback(lambda x: None)