On this page
logging.makeLogRecord
Prev: logging.LogRecord | Up: logging | Next: logging.NullHandler
Rel: logging.addLevelName, logging.basicConfig, logging.BufferingFormatter, logging.captureWarnings
Ref: docs.python.org — logging.makeLogRecord
Tags: #public #python3 #stdlib #logging
Import
import logging
from logging import makeLogRecord
Signature & Overview
logging.makeLogRecord(dict)
Make a LogRecord whose attributes are defined by the specified dictionary, This function is useful for converting a logging event received over a socket connection (which is sent as a dictionary) into a LogRecord
Usage
import logging
rec = logging.makeLogRecord({"name": "net", "levelno": logging.INFO, "msg": "received"})
assert rec.name == "net" and rec.getMessage() == "received"
Gotchas
- Used for deserializing log records: Handy when reconstructing
LogRecordobjects sent over a socket, pipe, or JSON queue.
REPL Inspect
from logging import makeLogRecord
help(makeLogRecord)
Linked from
Related notes
- tuts/python3/stdlib_module/logging/LogRecord Linked here; links to this page; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/NullHandler 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