logging.getLogRecordFactory
Prev: logging.getLoggerClass | Up: logging | Next: logging.Handler
Rel: logging.addLevelName, logging.basicConfig, logging.BufferingFormatter, logging.captureWarnings
Ref: docs.python.org — logging.getLogRecordFactory
Tags: #public #python3 #stdlib #logging
Import
import logging
from logging import getLogRecordFactory
Signature & Overview
logging.getLogRecordFactory()
Return the factory to be used when instantiating a log record.
Usage
import logging
factory = logging.getLogRecordFactory()
assert callable(factory)
Gotchas
- Pair with
setLogRecordFactory(): Always capture the previous factory and delegate to it rather than hardcodinglogging.LogRecord.
REPL Inspect
from logging import getLogRecordFactory
help(getLogRecordFactory)
Linked from
Related notes
- tuts/python3/stdlib_module/logging/getLoggerClass Linked here; links to this page; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/Handler Linked here; links to this page; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/logging/addLevelName Linked here; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/basicConfig Linked here; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/BufferingFormatter Linked here; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/captureWarnings Linked here; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/critical shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/debug shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/disable shared tags: #logging, #stdlib