You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`ERROR`| Failures that stop an operation | Parse error, invalid configuration |
314
+
315
+
#### Message style
316
+
317
+
- Lowercase, past tense for events: `"extension loaded"`, `"parse error"`
318
+
- No trailing punctuation
319
+
- Keep messages short; put details in `extra`, not the message string
320
+
321
+
#### Exception logging
322
+
323
+
- Use `logger.exception()` only inside `except` blocks when you are **not** re-raising
324
+
- Use `logger.error(..., exc_info=True)` when you need the traceback outside an `except` block
325
+
- Avoid `logger.exception()` followed by `raise` — this duplicates the traceback. Either add context via `extra` that would otherwise be lost, or let the exception propagate
326
+
327
+
#### Testing logs
328
+
329
+
Assert on `caplog.records` attributes, not string matching on `caplog.text`:
0 commit comments