PCPP 32 10x PCPP Certified Professional Python Programmer 1 · Free Practice Question Easy
Question 39
Which of the following logging levels has the highest level of severity for log messages in logging package?
-
A
ERROR -
B
INFO -
C
CRITICAL -
D
WARNING
Reveal correct answer
Correct answer: C
A.
The ERROR level is the second-highest severity level. It indicates that an error has occurred that prevents a particular operation from being completed, but it’s not as severe as a CRITICAL level issue.
B.
The INFO level is of even lower severity than WARNING. It is used for general informational messages that confirm the program is working as expected.
C.
This is the correct answer. The CRITICAL level is the highest level of severity, indicating a very serious error that could prevent the program from continuing to run. The logging package in Python provides a flexible framework for emitting log messages from Python programs. The logging module defines a set of standard logging levels that indicate the severity of an event. These levels are, in order of increasing severity:
DEBUG: Detailed information, typically of interest only when diagnosing problems.INFO: Confirmation that things are working as expected.WARNING: An indication that something unexpected happened, or indicative of some problem in the near future (e.g., ‘disk space low’). The software is still working as expected.ERROR: Due to a more serious problem, the software has not been able to perform some function.CRITICAL: A very serious error, indicating that the program itself may be unable to continue running.
D.
The WARNING level is of lower severity than ERROR and CRITICAL. It is used for indicating potential problems that do not necessarily stop the program from working.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
