Python Write Better Python Buggy Logs Log Messages

Spencer Hurrle
Spencer Hurrle
3,128 Points

I'm progressing, but I don't understand the formatting

Challenge Task 1 of 2 asked about creating a DEBUG message, but I don't understand why we use all caps (logging.DEBUG) when passing it to basicConfig, but we use lowercase when debug is being passed a message. Are these the same methods or are they two different things in logging?

starter.py
import logging

logging.basicConfig(filename='cc.log', level=logging.DEBUG)

# Write your code below here
logging.debug("Message")
logging.warning("The French have the Grail")

1 Answer

Steven Parker
Steven Parker
205,347 Points

The Python language is case-sensitive, and those are different things. The name "debug()" (lower case) is a method, and "DEBUG" (upper case) is a constant value.