On this page
logging.warning
Prev: logging.warn | Up: logging
Rel: logging.addLevelName, logging.basicConfig, logging.BufferingFormatter, logging.captureWarnings
Ref: docs.python.org — logging.warning
Tags: #public #python3 #stdlib #logging
Import
import logging
from logging import warning
Signature & Overview
logging.warning(msg, *args, **kwargs)
Log a message with severity 'WARNING' 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
assert logging.WARNING == 30 and callable(logging.warning)
Gotchas
- Default threshold of the root logger:
WARNING,ERROR, andCRITICALmessages are shown by default even without callingbasicConfig().
REPL Inspect
from logging import warning
help(warning)
Linked from
Related notes
- tuts/python3/stdlib_module/logging/warn 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
- tuts/python3/stdlib_module/logging/error shared tags: #logging, #stdlib