MCPcopy Create free account
hub / github.com/ipython/traitlets / _validate_log

Method _validate_log

traitlets/config/configurable.py:475–484  ·  view source on GitHub ↗
(self, proposal: Bunch)

Source from the content-addressed store, hash-verified

473
474 @validate("log")
475 def _validate_log(self, proposal: Bunch) -> LoggerType:
476 if not isinstance(proposal.value, (logging.Logger, logging.LoggerAdapter)):
477 # warn about unsupported type, but be lenient to allow for duck typing
478 warnings.warn(
479 f"{self.__class__.__name__}.log should be a Logger or LoggerAdapter,"
480 f" got {proposal.value}.",
481 UserWarning,
482 stacklevel=2,
483 )
484 return t.cast(LoggerType, proposal.value)
485
486 @default("log")
487 def _log_default(self) -> LoggerType:

Callers

nothing calls this directly

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected