On this page
  1. logging.makeLogRecord
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

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

REPL Inspect

from logging import makeLogRecord
help(makeLogRecord)

Linked from

Related notes