On this page
logging.log
Prev: logging.info | Up: logging | Next: logging.Logger
Rel: logging.addLevelName, logging.basicConfig, logging.BufferingFormatter, logging.captureWarnings
Ref: docs.python.org — logging.log
Tags: #public #python3 #stdlib #logging
Import
import logging
from logging import log
Signature & Overview
logging.log(level, msg, *args, **kwargs)
Log 'msg % args' with the integer severity 'level' on the root logger. If the logger has no handlers, call basicConfig() to add a console handler with a pre-defined format.
Usage
import logging
# Dynamic level logging: logging.log(level, msg, *args)
assert callable(logging.log)
Gotchas
levelmust be anint: Passing"INFO"raisesTypeError—convert withlogging.getLevelNamesMapping()["INFO"]first.
REPL Inspect
from logging import log
help(log)
Linked from
Related notes
- tuts/python3/stdlib_module/logging/info Linked here; links to this page; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/Logger 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