Skip to content

Commit

Permalink
metadata: drop timer based info log, reword
Browse files Browse the repository at this point in the history
The timer ticks forever. Usually, that's what we want to update the
metadata. Depending on the max age, this could be a noisy log, so let's
suppress it. The two other logs are much more valuable.
  • Loading branch information
twmb committed Oct 28, 2021
1 parent 4dadd65 commit 10ff785
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/kgo/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ func (cl *Client) updateMetadataLoop() {
case <-cl.ctx.Done():
return
case <-ticker.C:
cl.cfg.logger.Log(LogLevelInfo, "updating metadata due to max age ticker")
// We do not log on the standard update case.
case why := <-cl.updateMetadataCh:
cl.cfg.logger.Log(LogLevelInfo, "updating metadata", "why", why)
cl.cfg.logger.Log(LogLevelInfo, "metadata update triggered", "why", why)
case why := <-cl.updateMetadataNowCh:
cl.cfg.logger.Log(LogLevelInfo, "immediately updating metadata", "why", why)
cl.cfg.logger.Log(LogLevelInfo, "immediate metadata update triggered", "why", why)
now = true
}

Expand All @@ -139,7 +139,7 @@ func (cl *Client) updateMetadataLoop() {
return
case why := <-cl.updateMetadataNowCh:
timer.Stop()
cl.cfg.logger.Log(LogLevelInfo, "immediately updating metadata, bypassing normal metadata wait", "why", why)
cl.cfg.logger.Log(LogLevelInfo, "immediate metadata update triggered, bypassing normal wait", "why", why)
case <-timer.C:
}
}
Expand Down

0 comments on commit 10ff785

Please sign in to comment.