In django we have settings.py that defines the DEBUG for the whole project.
Now, My have debug level is independently configured in settings.py.
How should I use logging.DEBUG ?
Way1:
if settings.DEBUG:
logging.debug("Debug message")
Way2:
# Without checking settings.DEBUG
logging.debug("Debug message")
What is a good practice ?
I think we should use Way2 since logging level already decides - if the message will be logged or not. But, some say that Way1 is a standard practice.
loggingmodule, it should belogging.debug()and not all caps.