MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / class_logger

Function class_logger

lib/sqlalchemy/log.py:71–81  ·  view source on GitHub ↗
(cls: Type[_IT])

Source from the content-addressed store, hash-verified

69
70
71def class_logger(cls: Type[_IT]) -> Type[_IT]:
72 logger = logging.getLogger(_qual_logger_name_for_cls(cls))
73 cls._should_log_debug = lambda self: logger.isEnabledFor( # type: ignore[method-assign] # noqa: E501
74 logging.DEBUG
75 )
76 cls._should_log_info = lambda self: logger.isEnabledFor( # type: ignore[method-assign] # noqa: E501
77 logging.INFO
78 )
79 cls.logger = logger
80 _logged_classes.add(cls)
81 return cls
82
83
84_IdentifiedLoggerType = Union[logging.Logger, "InstanceLogger"]

Callers

nothing calls this directly

Calls 3

isEnabledForMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected