deprecate Handler.log
This commit is contained in:
parent
add9d363c5
commit
7c9c783e9d
|
@ -79,10 +79,11 @@ class ErrorHandler:
|
||||||
response = None
|
response = None
|
||||||
try:
|
try:
|
||||||
if handler:
|
if handler:
|
||||||
response = handler(request, exception)
|
response = handler(req, exception)
|
||||||
if response is None:
|
if response is None:
|
||||||
response = self.default(request, exception)
|
response = self.default(request, exception)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
self.log(format_exc())
|
||||||
try:
|
try:
|
||||||
url = repr(request.url)
|
url = repr(request.url)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
@ -99,12 +100,11 @@ class ErrorHandler:
|
||||||
|
|
||||||
def log(self, message, level='error'):
|
def log(self, message, level='error'):
|
||||||
"""
|
"""
|
||||||
Override this method in an ErrorHandler subclass to prevent
|
Deprecated, do not use.
|
||||||
logging exceptions.
|
|
||||||
"""
|
"""
|
||||||
getattr(logger, level)(message)
|
|
||||||
|
|
||||||
def default(self, request, exception):
|
def default(self, request, exception):
|
||||||
|
self.log(format_exc())
|
||||||
try:
|
try:
|
||||||
url = repr(request.url)
|
url = repr(request.url)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user