mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Add emergency print()s if we can't find class/qualname
This commit is contained in:
parent
89cadbc0eb
commit
4d7f81cec1
@ -991,9 +991,13 @@ class EDMCContextFilter(logging.Filter):
|
||||
if 'self' in frame.f_locals:
|
||||
# Paranoia checks
|
||||
frame_class = frame.f_locals['self'].__class__
|
||||
|
||||
if frame_class and frame_class.__qualname__:
|
||||
class_name = frame_class.__qualname__
|
||||
|
||||
if class_name = '':
|
||||
print('ALERT! Something went wrong with finding class name for logging!')
|
||||
|
||||
return class_name
|
||||
|
||||
def caller_qualname(self, skip=5) -> str:
|
||||
@ -1023,11 +1027,16 @@ class EDMCContextFilter(logging.Filter):
|
||||
frame = stack[start]
|
||||
if frame.f_locals and 'self' in frame.f_locals:
|
||||
# Paranoia checks
|
||||
|
||||
if frame.f_code and frame.f_code.co_name:
|
||||
fn = getattr(frame.f_locals['self'], frame.f_code.co_name)
|
||||
|
||||
if fn and fn.__qualname__:
|
||||
qualname = n.__qualname__
|
||||
|
||||
if qualname == '':
|
||||
print('ALERT! Something went wrong with finding caller qualname for logging!')
|
||||
|
||||
return qualname
|
||||
|
||||
###########################################################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user