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 be
| 2275 | # Null handler |
| 2276 | |
| 2277 | class NullHandler(Handler): |
| 2278 | """ |
| 2279 | This handler does nothing. It's intended to be used to avoid the |
| 2280 | "No handlers could be found for logger XXX" one-off warning. This is |
| 2281 | important for library code, which may contain code to log events. If a user |
| 2282 | of the library does not configure logging, the one-off warning might be |
| 2283 | produced; to avoid this, the library developer simply needs to instantiate |
| 2284 | a NullHandler and add it to the top-level logger of the library module or |
| 2285 | package. |
| 2286 | """ |
| 2287 | def handle(self, record): |
| 2288 | """Stub.""" |
| 2289 | |
| 2290 | def emit(self, record): |
| 2291 | """Stub.""" |
| 2292 | |
| 2293 | def createLock(self): |
| 2294 | self.lock = None |
| 2295 | |
| 2296 | def _at_fork_reinit(self): |
| 2297 | pass |
| 2298 | |
| 2299 | # Warnings integration |
| 2300 |