Return the default Handler Returns None if none can be found Deprecated, this now returns the first log handler which may or may not be the default one.
(self)
| 493 | return log.get_logger() |
| 494 | |
| 495 | def _get_log_handler(self) -> logging.Handler | None: |
| 496 | """Return the default Handler |
| 497 | |
| 498 | Returns None if none can be found |
| 499 | |
| 500 | Deprecated, this now returns the first log handler which may or may |
| 501 | not be the default one. |
| 502 | """ |
| 503 | if not self.log: |
| 504 | return None |
| 505 | logger: logging.Logger = ( |
| 506 | self.log if isinstance(self.log, logging.Logger) else self.log.logger |
| 507 | ) |
| 508 | if not getattr(logger, "handlers", None): |
| 509 | # no handlers attribute or empty handlers list |
| 510 | return None |
| 511 | return logger.handlers[0] |
| 512 | |
| 513 | |
| 514 | CT = t.TypeVar("CT", bound="SingletonConfigurable") |
nothing calls this directly
no outgoing calls
no test coverage detected