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

Method __init__

traitlets/config/loader.py:490–509  ·  view source on GitHub ↗

A base class for config loaders. log : instance of :class:`logging.Logger` to use. By default logger of :meth:`traitlets.config.application.Application.instance()` will be used Examples -------- >>> cl = ConfigLoader() >>> config

(self, log: Logger | None = None)

Source from the content-addressed store, hash-verified

488 return t.cast(Logger, get_logger())
489
490 def __init__(self, log: Logger | None = None) -> None:
491 """A base class for config loaders.
492
493 log : instance of :class:`logging.Logger` to use.
494 By default logger of :meth:`traitlets.config.application.Application.instance()`
495 will be used
496
497 Examples
498 --------
499 >>> cl = ConfigLoader()
500 >>> config = cl.load_config()
501 >>> config
502 {}
503 """
504 self.clear()
505 if log is None:
506 self.log = self._log_default()
507 self.log.debug("Using default logger")
508 else:
509 self.log = log
510
511 def clear(self) -> None:
512 self.config = Config()

Callers

nothing calls this directly

Calls 2

clearMethod · 0.95
_log_defaultMethod · 0.95

Tested by

no test coverage detected