Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Python

logging.INFO — informational level

logging.INFO is the constant 20, identifying events during normal program operation. Using it as a threshold admits INFO and higher levels, but excludes DEBUG.

Version: Python 3.14; repository image, production runtime not attested

Syntax

logging.INFO

logging.INFO is an integer constant with value 20, not a function. It identifies routine events confirming normal program operation, such as completing data processing. DEBUG is for detailed diagnostics, whereas WARNING signals an unexpected situation or possible problem.

Distinguish an event's level from a logger's threshold. logging.info(...) reports an INFO event through the root logger; logging.log(logging.INFO, ...) supplies the level explicitly. A logging.INFO threshold admits INFO, WARNING, ERROR, and CRITICAL, but rejects DEBUG. Handlers and filters can further restrict output.

The root logger's default threshold is WARNING, so INFO messages are normally invisible without configuration. The example sets the threshold and format through logging.basicConfig(...). Run it in a fresh process: if the root logger already has handlers, this call does not change the configuration by default.

Examples

import logging
import sys

logging.basicConfig(
    level=logging.INFO,
    format="%(levelname)s: %(message)s",
    stream=sys.stdout,
)

logging.debug("Diagnostic details")
logging.info("Processed %d items", 3)
logging.warning("Queue nearly full")

Result

INFO: Processed 3 items
WARNING: Queue nearly full

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources