⚑ IT Wisdom We call it "legacy code" because "haunted nightmare spaghetti" isn't professional.
Skilled Practitioner
4249 XP 1751 to Expert
Objective: Configure the logging module and write log messages at the correct severity levels.
Instructions

Create a file called lab1.py. Configure the logging module and write four log messages.

Requirements: - Format: %(levelname)s %(message)s β€” no timestamp - Level: INFO (DEBUG messages must not appear)

Write these four log events in order:

  1. INFO β€” Starting device inventory check
  2. INFO β€” Processing sw-core-01
  3. WARNING β€” sw-access-02 did not respond
  4. ERROR β€” Failed to process rtr-edge-01

Your output must match exactly:

INFO Starting device inventory check
INFO Processing sw-core-01
WARNING sw-access-02 did not respond
ERROR Failed to process rtr-edge-01

Run it with python3 lab1.py. Paste your output below and submit.

πŸ’‘ Show Hint
import logging. logging.basicConfig(level=logging.INFO, format="%(levelname)s %(message)s"). Then logging.info(), logging.warning(), and logging.error() for the four messages. No timestamp needed β€” leave datefmt out of basicConfig.
Paste Your Output
Next Lab β†’