Commit c3ad445
fix(tools/looker): log request/response traces at debug, not error (#3552)
## Description
The `looker-get-dashboards` and `looker-generate-embed-url` tools log
their
routine "Making request" / "Got response" traces with
`logger.ErrorContext`,
while every other Looker tool logs the same kind of trace with
`logger.DebugContext`. `StdLogger` routes `Error` to stderr, and these
two tools
emit the trace on every successful call, so normal, healthy operation
produces
ERROR-severity stderr lines: log spam, and false positives for anyone
running
log-based alerting. At the default log level the corrected
`DebugContext` lines
are suppressed entirely.
This switches the four calls to `DebugContext` so they match the package
convention and are debug-only. The `looker-get-dashboards` function
already logs
the response elements at debug one line later, so the edited lines now
match
their own surroundings. Message strings are unchanged; this is purely a
severity
fix.
## PR Checklist
- [x] Make sure you reviewed
[CONTRIBUTING.md](https://github.com/googleapis/mcp-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a
[bug/issue](https://github.com/googleapis/mcp-toolbox/issues/new/choose)
before writing your code -- not opened: this is a small, self-contained
severity fix. Happy to file one if you'd prefer.
- [x] Ensure the tests and linter pass -- `gofmt`, `go vet`, `go build
./...`,
and `go test -race` on `internal/tools/looker/lookergetdashboards`,
`internal/tools/looker/lookergenerateembedurl`, and `internal/log` all
pass.
- [x] Code coverage does not decrease -- no behavioral seam changed; the
logging
contract (Debug routes to the out stream and is suppressed at the
default
level; Error routes to the err stream) is already covered by
`internal/log/log_test.go` (`TestStdLogger`).
- [x] Appropriate docs were updated -- none needed.
- [x] Make sure to add `!` if this involves a breaking change -- not a
breaking
change.
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>1 parent 3ebe500 commit c3ad445
2 files changed
Lines changed: 4 additions & 4 deletions
File tree
- internal/tools/looker
- lookergenerateembedurl
- lookergetdashboards
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
0 commit comments