PyDocs

Generic Operating System Services

logging

Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python.

Copyright (C) 2001-2022 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging' and log away!
Symbols in logging

a

addLevelName
Associate 'levelName' with 'level'.

b

basicConfig
Do basic configuration for the logging system.
BufferingFormatter
A formatter suitable for formatting a number of records.

c

captureWarnings
If capture is true, redirect all warnings to the logging package.
critical
Log a message with severity 'CRITICAL' on the root logger.

d

debug
Log a message with severity 'DEBUG' on the root logger.
disable
Disable all logging calls of severity 'level' and below.

e

error
Log a message with severity 'ERROR' on the root logger.
exception
Log a message with severity 'ERROR' on the root logger, with exception information.

f

FileHandler
A handler class which writes formatted logging records to disk files.
Filter
Filter instances are used to perform arbitrary filtering of LogRecords.
Formatter
Formatter instances are used to convert a LogRecord to text.

g

getHandlerByName
Get a handler with the specified *name*, or None if there isn't one with that name.
getHandlerNames
Return all known handler names as an immutable set.
getLevelName
Return the textual or numeric representation of logging level 'level'.
getLevelNamesMapping
Returns a mapping from level names to their corresponding logging levels.
getLogger
Return a logger with the specified name, creating it if necessary.
getLoggerClass
Return the class to be used when instantiating a logger.
getLogRecordFactory
Return the factory to be used when instantiating a log record.

h

Handler
Handler instances dispatch logging events to specific destinations.

i

info
Log a message with severity 'INFO' on the root logger.

l

lastResort
A “handler of last resort” is available through this attribute.
log
Log 'msg % args' with the integer severity 'level' on the root logger.
Logger
Instances of the Logger class represent a single logging channel.
LoggerAdapter
An adapter for loggers which makes it easier to specify contextual information in logging output.
LogRecord
A LogRecord instance represents an event being logged.

m

makeLogRecord
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) int…

n

NullHandler
This handler does nothing.

r

raiseExceptions
Used to see if exceptions during handling should be propagated.

s

setLoggerClass
Set the class to be used when instantiating a logger.
setLogRecordFactory
Set the factory to be used when instantiating a log record.
shutdown
Perform any cleanup actions in the logging system (e.g.
StreamHandler
A handler class which writes logging records, appropriately formatted, to a stream.

w

warning
Log a message with severity 'WARNING' on the root logger.