MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / log

Method log

lib/sqlalchemy/log.py:180–205  ·  lib/sqlalchemy/log.py::InstanceLogger.log

Delegate a log call to the underlying logger. The level here is determined by the echo flag as well as that of the underlying logger, and logger._log() is called directly.

(self, level: int, msg: str, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

178 self.log(logging.CRITICAL, msg, *args, **kwargs)
179
180 def log(self, level: int, msg: str, *args: Any, **kwargs: Any) -> None:
181 class="st">"""Delegate a log call to the underlying logger.
182
183 The level here is determined by the echo
184 flag as well as that of the underlying logger, and
185 logger._log() is called directly.
186
187 class="st">"""
188
189 class="cm"># inline the logic from isEnabledFor(),
190 class="cm"># getEffectiveLevel(), to avoid overhead.
191
192 if self.logger.manager.disable >= level:
193 return
194
195 selected_level = self._echo_map[self.echo]
196 if selected_level == logging.NOTSET:
197 selected_level = self.logger.getEffectiveLevel()
198
199 if level >= selected_level:
200 if STACKLEVEL:
201 kwargs[class="st">"stacklevel"] = (
202 kwargs.get(class="st">"stacklevel", 1) + STACKLEVEL_OFFSET
203 )
204
205 self.logger._log(level, msg, args, **kwargs)
206
207 def isEnabledFor(self, level: int) -> bool:
208 class="st">""class="st">"Is this logger enabled for level &class="cm">#x27;level'?"class="st">""

Callers 7

debugMethod · 0.95
infoMethod · 0.95
warningMethod · 0.95
errorMethod · 0.95
exceptionMethod · 0.95
criticalMethod · 0.95
apply_pytest_optsFunction · 0.80

Calls 3

getEffectiveLevelMethod · 0.80
_logMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected