mirror of
https://github.com/janeczku/calibre-web
synced 2024-12-26 01:50:31 +00:00
Fixed logging of exception in debug_or_exception handler for python version <3.8
This commit is contained in:
parent
e5f754ed0e
commit
9acea8adf4
@ -44,10 +44,22 @@ logging.addLevelName(logging.CRITICAL, "CRIT")
|
|||||||
class _Logger(logging.Logger):
|
class _Logger(logging.Logger):
|
||||||
|
|
||||||
def debug_or_exception(self, message, *args, **kwargs):
|
def debug_or_exception(self, message, *args, **kwargs):
|
||||||
if is_debug_enabled():
|
if sys.version_info > (3, 7):
|
||||||
self.exception(message, stacklevel=2, *args, **kwargs)
|
if is_debug_enabled():
|
||||||
|
self.exception(message, stacklevel=2, *args, **kwargs)
|
||||||
|
else:
|
||||||
|
self.error(message, stacklevel=2, *args, **kwargs)
|
||||||
|
elif sys.version_info > (3, 0):
|
||||||
|
if is_debug_enabled():
|
||||||
|
self.exception(message, stack_info=True, *args, **kwargs)
|
||||||
|
else:
|
||||||
|
self.error(message, *args, **kwargs)
|
||||||
else:
|
else:
|
||||||
self.error(message, stacklevel=2, *args, **kwargs)
|
if is_debug_enabled():
|
||||||
|
self.exception(message, *args, **kwargs)
|
||||||
|
else:
|
||||||
|
self.error(message, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def debug_no_auth(self, message, *args, **kwargs):
|
def debug_no_auth(self, message, *args, **kwargs):
|
||||||
if message.startswith("send: AUTH"):
|
if message.startswith("send: AUTH"):
|
||||||
|
Loading…
Reference in New Issue
Block a user