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)
| 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">"" |