Logging Levels

noun

say it: “LOG-ing LEV-ulz” /ˈlɒɡɪŋ ˈlɛvəlz/

How serious a log message is: DEBUG, INFO, WARNING, ERROR or CRITICAL; a logger set to one level shows that level and the ones above it.

What are logging levels?

Logging levels say how serious a log message is: DEBUG, INFO, WARNING, ERROR, CRITICAL. You choose the lowest level to show, so everyday runs aren't flooded with detail.

import logging
logging.basicConfig(level=logging.WARNING)
logging.info("Cart loaded")        # hidden: below WARNING
logging.error("Payment declined")  # shown

In a sentence

  • “The five logging levels run from DEBUG up to CRITICAL.”
  • “Choosing between logging levels, Ana logged the failed payment as ERROR and the startup as INFO.”

Level: Freelancer · More Python terms at this level

Updated