Skip to content

Commit 00d41fe

Browse files
feat: change log level for token fetch message to debug (#294)
Fixes #293 and provides some context where the message is coming from. The OAuth2 M2M authenticator currently logs token fetch operations at the Info level in auth/oauth/m2m/m2m.go at line 60. When running applications with Info-level logging enabled, this generates log entries every time a token is fetched or refreshed, which pollutes application logs with operational noise. Its also messing with my Ginkgo tests in CI: onsi/ginkgo#1614 (comment). Libraries should generally avoid logging at Info level during normal operations unless there's actionable information for the application operator. I think this is a pretty standard practice.
2 parents dc1ba66 + 183ff05 commit 00d41fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

auth/oauth/m2m/m2m.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (c *authClient) Authenticate(r *http.Request) error {
5757

5858
c.tokenSource = GetTokenSource(config)
5959
token, err := c.tokenSource.Token()
60-
log.Debug().Msgf("token fetched successfully")
60+
log.Debug().Msgf("databricks OAuth token fetched successfully")
6161
if err != nil {
6262
log.Err(err).Msg("failed to get token")
6363

0 commit comments

Comments
 (0)