PCPP 32 10x PCPP Certified Professional Python Programmer 1 · Free Practice Question Easy

Question 42

Which of the following logs represents the default formatting of the root logger (logging module)?

  • A

    CRITICAL:root:Message

  • B

    Message:CRITICAL:root

  • C

    root:Message:CRITICAL

  • D

    CRITICAL:Message:root

Reveal correct answer

Correct answer: A

A.

This matches the default log format of the root logger, where CRITICAL is the log level, root is the name of the logger, and Message is the log message.


Example:



Output:


B.

This format is incorrect because it places the message first, followed by the log level and logger name, which is not how the default logging format is structured.

C.

This format incorrectly positions the logger name before the message and the log level.

D.

This format places the log level first, followed by the message and logger name, which does not match the default formatting.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need