MCPcopy
hub / github.com/celery/celery / logger_isa

Function logger_isa

celery/utils/log.py:72–88  ·  view source on GitHub ↗
(l, p, max=1000)

Source from the content-addressed store, hash-verified

70
71
72def logger_isa(l, p, max=1000):
73 this, seen = l, set()
74 for _ in range(max):
75 if this == p:
76 return True
77 else:
78 if this in seen:
79 raise RuntimeError(
80 f'Logger {l.name!r} parents recursive',
81 )
82 seen.add(this)
83 this = this.parent
84 if not this:
85 break
86 else: # pragma: no cover
87 raise RuntimeError(f'Logger hierarchy exceeds {max}')
88 return False
89
90
91def _using_logger_parent(parent_logger, logger_):

Callers 3

test_isaMethod · 0.90
test_recursiveMethod · 0.90
_using_logger_parentFunction · 0.85

Calls 1

addMethod · 0.45

Tested by 2

test_isaMethod · 0.72
test_recursiveMethod · 0.72