From 0e56af11bc12fafe3b5bb8cdec80de6d364615b5 Mon Sep 17 00:00:00 2001 From: Cheng-Zhen Yang Date: Sun, 27 Oct 2024 02:02:50 +1300 Subject: [PATCH] Fix comments on WithLevelSeverity --- bridges/otellogr/logsink.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bridges/otellogr/logsink.go b/bridges/otellogr/logsink.go index 7e51e815a30..2bd4cb2efb1 100644 --- a/bridges/otellogr/logsink.go +++ b/bridges/otellogr/logsink.go @@ -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