Commit d412a6b
authored
[log] middleware: add debug logging calls to jqschema (#4912)
## Summary
Adds `logMiddleware.Printf` debug logging calls to
`internal/middleware/jqschema.go`.
The `logMiddleware` logger was declared (`var logMiddleware =
logger.New("middleware:jqschema")`) but never used. This PR activates it
with 4 meaningful logging calls:
### Changes
- **`WrapToolHandler`** – logs when a tool handler is wrapped with the
middleware, including `toolName`, `sizeThreshold`, `baseDir`, and
whether a `pathPrefix` is set
- **`applyJqSchema`** (entry) – logs the start of schema inference with
the Go type of the input data
- **`applyJqSchema`** (exit) – logs successful schema inference with the
result type
- **`ShouldApplyMiddleware`** – logs the apply/skip decision for each
tool
### Why this matters
The existing operational logging uses `logger.LogInfo/LogDebug` (written
to files). The `logMiddleware` calls provide developer-facing trace
output enabled only when `DEBUG=middleware:*` is set, following the
pattern used throughout the codebase.
### Testing
- All unit tests pass: `go test ./internal/middleware/...`
- No new imports required (logger package already imported)
- No side effects in log arguments
> [!WARNING]
> **1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
| |||
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
| 217 | + | |
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| |||
288 | 291 | | |
289 | 292 | | |
290 | 293 | | |
| 294 | + | |
| 295 | + | |
291 | 296 | | |
292 | 297 | | |
293 | 298 | | |
| |||
475 | 480 | | |
476 | 481 | | |
477 | 482 | | |
478 | | - | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
479 | 486 | | |
0 commit comments