Skip to content

Commit

Permalink
Avoid formatting log args when not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
poszu committed Sep 8, 2023
1 parent e2f465e commit ae739f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions activation/poet.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ type retryableHttpLogger struct {
}

func (r retryableHttpLogger) Error(format string, args ...any) {
r.inner.Sugar().With(args...).Error(format)
r.inner.Sugar().Errorw(format, args...)
}

func (r retryableHttpLogger) Info(format string, args ...any) {
r.inner.Sugar().With(args...).Info(format)
r.inner.Sugar().Infow(format, args...)

Check warning on line 68 in activation/poet.go

View check run for this annotation

Codecov / codecov/patch

activation/poet.go#L67-L68

Added lines #L67 - L68 were not covered by tests
}

func (r retryableHttpLogger) Warn(format string, args ...any) {
r.inner.Sugar().With(args...).Warn(format)
r.inner.Sugar().Warnw(format, args...)

Check warning on line 72 in activation/poet.go

View check run for this annotation

Codecov / codecov/patch

activation/poet.go#L71-L72

Added lines #L71 - L72 were not covered by tests
}

func (r retryableHttpLogger) Debug(format string, args ...any) {
r.inner.Sugar().With(args...).Debug(format)
r.inner.Sugar().Debugw(format, args...)
}

type PoetClientOpts func(*HTTPPoetClient)
Expand Down

0 comments on commit ae739f2

Please sign in to comment.