Skip to content

Commit

Permalink
Fix comments on WithLevelSeverity
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpionknifes committed Oct 26, 2024
1 parent be7773d commit 0e56af1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bridges/otellogr/logsink.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ func WithLoggerProvider(provider log.LoggerProvider) Option {
// convert logr levels to OpenTelemetry log severities.
//
// By default if this Option is not provided, the LogSink will use a default
// conversion function which adds an offset to the logr level to get the
// OpenTelemetry severity. The offset is such that logr.Info("message")
// converts to OpenTelemetry [log.SeverityInfo].
// conversion function that transforms in the following way:
//
// - logr.Info and logr.V(0) are transformed to [log.SeverityInfo].
// - logr.V(1) is transformed to [log.SeverityDebug].
// - logr.V(2) and higher are transformed to [log.SeverityTrace].
func WithLevelSeverity(f func(int) log.Severity) Option {
return optFunc(func(c config) config {
c.levelSeverity = f
Expand Down

0 comments on commit 0e56af1

Please sign in to comment.