Interview Prep/Python for DevOps/Automation scripting & CLI design

A new joiner asks why your team's scripts all use `logging.getLogger(__name__)` instead of the root logger. How do you explain it?

BeginnerScenarioAutomation scripting & CLI design
Answer

Situation read → Teaching moment about logger hierarchy.

What I'd do →

  1. Explain that named loggers show which module emitted a line (cloudaudit.checks).
  2. Levels can be tuned per module: logging.getLogger("cloudaudit.checks").setLevel("DEBUG") without drowning in botocore debug logs.
  3. Libraries should never configure the root logger; the application does it once in main().

Why → Named loggers give control and context for free.

Interview tip → Mention silencing botocore and urllib3 to WARNING as a practical example.

All Python for DevOps questions Roadmap: Python for automation

More on Automation scripting & CLI design