MCPcopy Create free account
hub / github.com/hynek/structlog / is_enabled_for

Method is_enabled_for

src/structlog/stdlib.py:415–429  ·  view source on GitHub ↗

A snake_case alias of `isEnabledFor` for compatibility with `structlog.typing.FilteringBoundLogger`. .. note:: This method is more complex than the native `is_enabled_for` since it supports standard library-only features like :attr:`logging

(self, level: int)

Source from the content-addressed store, hash-verified

413 return self._logger.isEnabledFor(level)
414
415 def is_enabled_for(self, level: int) -> bool:
416 """
417 A snake_case alias of `isEnabledFor` for compatibility with
418 `structlog.typing.FilteringBoundLogger`.
419
420 .. note::
421
422 This method is more complex than the native `is_enabled_for` since
423 it supports standard library-only features like
424 :attr:`logging.Logger.disabled` while the native one only compares
425 log levels.
426
427 .. versionadded:: 26.1.0
428 """
429 return self._logger.isEnabledFor(level)
430
431 def get_effective_level(self) -> int:
432 """

Callers 3

test_is_enabled_forMethod · 0.95
test_is_enabled_forMethod · 0.45
api.pyFile · 0.45

Calls 1

isEnabledForMethod · 0.80

Tested by 2

test_is_enabled_forMethod · 0.76
test_is_enabled_forMethod · 0.36