fix(tools/looker): log request/response traces at debug, not error#3552
fix(tools/looker): log request/response traces at debug, not error#3552anxkhn wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates the logging level in Looker tools (lookergenerateembedurl and lookergetdashboards) from Error to Debug when logging requests and responses. This prevents polluting the error logs with standard operational messages. There are no review comments, and I have no additional feedback to provide.
5a0c54c to
2fa82e5
Compare
|
/gcbrun |
|
@anxkhn please sign the CLA and we should be good to go. |
|
@googlebot rescan |
|
@drstrangelooker I am trying to re trigger cla, looks like I will have to use my @gmail.com which I signed cla with and cannot use |
The looker-get-dashboards and looker-generate-embed-url tools logged their "Making request"/"Got response" traces with logger.ErrorContext, while every other Looker tool logs the same traces with logger.DebugContext. Because StdLogger routes Error to stderr, these routine, successful traces surfaced as ERROR-severity stderr lines on every call at the default log level: log spam and false positives for log-based alerting. Switch the four calls to DebugContext so they match the package convention and are suppressed at the default log level. Message strings are unchanged.
2fa82e5 to
a39eba3
Compare
Description
The
looker-get-dashboardsandlooker-generate-embed-urltools log theirroutine "Making request" / "Got response" traces with
logger.ErrorContext,while every other Looker tool logs the same kind of trace with
logger.DebugContext.StdLoggerroutesErrorto stderr, and these two toolsemit 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
DebugContextlinesare suppressed entirely.
This switches the four calls to
DebugContextso they match the packageconvention and are debug-only. The
looker-get-dashboardsfunction already logsthe 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
CONTRIBUTING.md
bug/issue
before writing your code -- not opened: this is a small, self-contained
severity fix. Happy to file one if you'd prefer.
gofmt,go vet,go build ./...,and
go test -raceoninternal/tools/looker/lookergetdashboards,internal/tools/looker/lookergenerateembedurl, andinternal/logall pass.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).!if this involves a breaking change -- not a breakingchange.