
Predict
Turn Down the Noise
Remember the ladder: DEBUG < INFO < WARNING < ERROR <
CRITICAL. The configured level is the lowest one that gets through.
import logging, sys
logging.basicConfig(level=logging.WARNING, stream=sys.stdout,
format="%(levelname)s %(message)s", force=True)
log = logging.getLogger("tower")
log.debug("checking wick")
log.info("lantern lit")
log.warning("fuel low")
log.error("glass cracked")