From 7c9c783e9d8618a0256c9c95f071374a39b0ee34 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Fri, 5 Oct 2018 16:30:33 +0200 Subject: [PATCH] deprecate Handler.log --- sanic/handlers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sanic/handlers.py b/sanic/handlers.py index dbc7b42a..b8c7ded0 100644 --- a/sanic/handlers.py +++ b/sanic/handlers.py @@ -79,10 +79,11 @@ class ErrorHandler: response = None try: if handler: - response = handler(request, exception) + response = handler(req, exception) if response is None: response = self.default(request, exception) except Exception: + self.log(format_exc()) try: url = repr(request.url) except AttributeError: @@ -99,12 +100,11 @@ class ErrorHandler: def log(self, message, level='error'): """ - Override this method in an ErrorHandler subclass to prevent - logging exceptions. + Deprecated, do not use. """ - getattr(logger, level)(message) def default(self, request, exception): + self.log(format_exc()) try: url = repr(request.url) except AttributeError: