diff --git a/example/main.go b/example/main.go index f17bca4..e88dbb2 100644 --- a/example/main.go +++ b/example/main.go @@ -37,7 +37,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 5b05711..0b10b50 100644 --- a/stdr.go +++ b/stdr.go @@ -196,9 +196,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 } @@ -221,4 +221,3 @@ func (l logger) WithValues(kvList ...interface{}) logr.Logger { } var _ logr.Logger = logger{} -var _ logr.InfoLogger = logger{}