Quiz

What Belongs in a Log?

A tool talks to two audiences:

  • The report is for the person who wanted the job done. It's short and friendly.
  • The log is for whoever fixes the tool later. It has times, levels (DEBUG, INFO, WARNING, ERROR) and details.

Logs get copied, emailed, pasted into chats and kept for years. So think about who might read them.

import logging
logging.warning("notes.txt skipped: target exists")

Pip's import tool writes these log lines. Which one should never be logged?