MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / NullHandler

Class NullHandler

tools/python-3.11.9-amd64/Lib/logging/__init__.py:2206–2226  ·  view source on GitHub ↗

This handler does nothing. It's intended to be used to avoid the "No handlers could be found for logger XXX" one-off warning. This is important for library code, which may contain code to log events. If a user of the library does not configure logging, the one-off warning might

Source from the content-addressed store, hash-verified

2204# Null handler
2205
2206class NullHandler(Handler):
2207 """
2208 This handler does nothing. It's intended to be used to avoid the
2209 "No handlers could be found for logger XXX" one-off warning. This is
2210 important for library code, which may contain code to log events. If a user
2211 of the library does not configure logging, the one-off warning might be
2212 produced; to avoid this, the library developer simply needs to instantiate
2213 a NullHandler and add it to the top-level logger of the library module or
2214 package.
2215 """
2216 def handle(self, record):
2217 """Stub."""
2218
2219 def emit(self, record):
2220 """Stub."""
2221
2222 def createLock(self):
2223 self.lock = None
2224
2225 def _at_fork_reinit(self):
2226 pass
2227
2228# Warnings integration
2229

Callers 4

__init__.pyFile · 0.90
__init__.pyFile · 0.90
__init__.pyFile · 0.90
_showwarningFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected