The Log Tsunami
Difficulty: EASYID: obs-structured-logging
The Scenario
You are debugging an issue. You grep the logs:
grep "Error" logs.txt
Output:
Error: Connection failed
Error: Connection failed
Error: Connection failed
Which user? Which model? Which region? You have no idea.
The Goal
Switch from Text Logging to Structured JSON Logging. Output a JSON object for every log:
{"level": "error", "msg": "Connection failed", "user_id": "u_123", "region": "us-east"}
Requirements:
- Function
log_event(level, message, context) - Output valid JSON string.
- Include
timestamp(mocked is fine).
solution.py
Loading...
⚠️ Do not include PII or secrets in your code.
SYSTEM_LOGS
5/5
// Waiting for execution trigger...
PREVIEW MODE — SOLVE PREVIOUS MISSIONS TO UNLOCK