diff --git a/example/main.go b/example/main.go index 4dac980..cd756fb 100644 --- a/example/main.go +++ b/example/main.go @@ -21,7 +21,7 @@ func main() { log = log.WithName("MyName").WithValues("user", "you") log.Info("hello", "val1", 1, "val2", map[string]int{"k": 1}) log.V(1).Info("you should see this") - log.V(3).Info("you should NOT see this") + log.V(1).V(1).Info("you should NOT see this") log.Error(nil, "uh oh", "trouble", true, "reasons", []float64{0.1, 0.11, 3.14}) log.Error(E{"an error occurred"}, "goodbye", "code", -1) } diff --git a/stdr.go b/stdr.go index 7e44f9a..7ca9a8f 100644 --- a/stdr.go +++ b/stdr.go @@ -180,9 +180,9 @@ func (l logger) output(calldepth int, s string) { } } -func (l logger) V(level int) logr.InfoLogger { +func (l logger) V(level int) logr.Logger { new := l.clone() - new.level = level + new.level += level return new } @@ -205,4 +205,3 @@ func (l logger) WithValues(kvList ...interface{}) logr.Logger { } var _ logr.Logger = logger{} -var _ logr.InfoLogger = logger{}