Commit 1f45ba0
docs(middleware): LoggingMiddleware uses logging, not print()
The example previously used `print(...)` to demonstrate a middleware that
records inbound/outbound traffic. CLAUDE.md lists "No print()" as a
non-negotiable architecture invariant, so the doc example would fail CI
in a user's own project if they followed the project's conventions.
Rewrite with a module-level `_LOGGER = logging.getLogger("myapp.logging_middleware")`
and `_LOGGER.info(...)` calls, matching the existing RequestIdMiddleware
example's style further down the same file.
Closes audit Nit finding (docs/middleware.md:156-161) from
planning/audit/2026-06-07-deep-audit.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3bf5d4b commit 1f45ba0
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
156 | 161 | | |
157 | 162 | | |
158 | | - | |
| 163 | + | |
159 | 164 | | |
160 | | - | |
| 165 | + | |
161 | 166 | | |
162 | 167 | | |
163 | 168 | | |
| |||
0 commit comments