2

I'm having trouble finding an authoritative reference which describes correct usage for each of the five logging levels in Python (DEBUG, INFO, WARNING, ERROR, CRITICAL). The docs are not specifying it:

Also found a few blogs with some personal opinions, but nothing "official" that could for example serve to settle a difference of opinions.

Is there such a reference out there?

1
  • what sort of guidance do you need, have you seen: en.wikipedia.org/wiki/Syslog. the levels are pretty arbitrary in my head, what's useful at each level generally becomes obvious with experience Commented Dec 22, 2018 at 22:52

2 Answers 2

2

The docs do specify this information. See here. Be sure to read the whole of the section.

Sign up to request clarification or add additional context in comments.

Comments

0

Those level are not specific to Python logging but are common to most logging system and originate from Unix syslog. They can be adjusted per application or system, but the common usage is:

  • DEBUG: message that should not be used in normal usage but can help to debug the application. Typically milestones in a chained processing to more easily find where an error occurs
  • NOTICE: normal messages that should always be present. Typically start and stop of an application or a subsystem
  • WARNING: abnormal condition but the processing could continue. Typically space becoming low on a disk device or a function detected incorrect characters in a field but could use a fallback strategy
  • ERROR: an operation could not be processed but the application can continue to process other operations. Typically an invalid value was detected and lead to an transaction abort
  • CRITICAL: the application cannot continue. Typically the connection to the database was lost and could not be recovered, or a disk cannot be reached...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.