On this page
logging.critical
Prev: logging.captureWarnings | Up: logging | Next: logging.debug
Rel: logging.addLevelName, logging.basicConfig, logging.BufferingFormatter, logging.captureWarnings
Ref: docs.python.org — logging.critical
Tags: #public #python3 #stdlib #logging
Import
import logging
from logging import critical
Signature & Overview
logging.critical(msg, *args, **kwargs)
Log a message with severity 'CRITICAL' 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
# Logs a CRITICAL (level 50) message on the root logger
assert logging.CRITICAL == 50 and callable(logging.critical)
Gotchas
- Uses the root logger: In modules/libraries, prefer
logger = logging.getLogger(__name__); logger.critical(...)so the module name is preserved.
REPL Inspect
from logging import critical
help(critical)
Linked from
Related notes
- tuts/python3/stdlib_module/logging/addLevelName Linked here; links to this page; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/basicConfig Linked here; links to this page; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/BufferingFormatter Linked here; links to this page; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/captureWarnings Linked here; links to this page; shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/debug 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/disable shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/error shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/exception shared tags: #logging, #stdlib
- tuts/python3/stdlib_module/logging/fatal shared tags: #logging, #stdlib