logger_isa
Determines if a logger is an instance of or a descendant of a specific parent logger by traversing the logger hierarchy. It raises a RuntimeError if a circular reference is detected or if the hierarchy depth exceeds the specified maximum.
def logger_isa(
l: logging.Logger,
p: logging.Logger,
max: int = 1000
) - > boolean
Checks if a logger is a descendant of a specific parent logger by traversing the hierarchy upwards.
Parameters
| Name | Type | Description |
|---|---|---|
| l | logging.Logger | The child logger instance to start the search from. |
| p | logging.Logger | The potential ancestor logger instance to check against. |
| max | int = 1000 | The maximum depth to traverse before raising a RuntimeError to prevent infinite loops. |
Returns
| Type | Description |
|---|---|
boolean | True if the parent logger is found in the hierarchy, False if the root is reached without a match. |