Skip to content

Commit 1a1d5cc

Browse files
author
Mengqi Yu
committed
fix vendor logr
1 parent aee8cec commit 1a1d5cc

File tree

20 files changed

+834
-198
lines changed

20 files changed

+834
-198
lines changed

Gopkg.lock

Lines changed: 17 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,5 @@ required = ["sigs.k8s.io/testing_frameworks/integration",
5050
name = "k8s.io/kube-aggregator"
5151
version = "kubernetes-1.10.1"
5252

53-
[[constraint]]
54-
name = "github.com/thockin/logr"
55-
source = "https://github.com/directxman12/logr.git"
56-
branch = "features/structed"
57-
5853
[prune]
5954
go-tests = true

pkg/runtime/log/deleg.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package log
22

33
import (
4-
"github.com/thockin/logr"
4+
"github.com/go-logr/logr"
55
)
66

77
// loggerPromise knows how to populate a concrete logr.Logger
@@ -24,8 +24,8 @@ func (p *loggerPromise) WithName(l *DelegatingLogger, name string) *loggerPromis
2424
return res
2525
}
2626

27-
// WithTags provides a new Logger with the tags appended
28-
func (p *loggerPromise) WithTags(l *DelegatingLogger, tags ...interface{}) *loggerPromise {
27+
// WithValues provides a new Logger with the tags appended
28+
func (p *loggerPromise) WithValues(l *DelegatingLogger, tags ...interface{}) *loggerPromise {
2929
res := &loggerPromise{
3030
logger: l,
3131
tags: tags,
@@ -42,7 +42,7 @@ func (p *loggerPromise) Fulfill(parentLogger logr.Logger) {
4242
}
4343

4444
if p.tags != nil {
45-
logger = logger.WithTags(p.tags...)
45+
logger = logger.WithValues(p.tags...)
4646
}
4747

4848
p.logger.Logger = logger
@@ -76,14 +76,14 @@ func (l *DelegatingLogger) WithName(name string) logr.Logger {
7676
return res
7777
}
7878

79-
// WithTags provides a new Logger with the tags appended
80-
func (l *DelegatingLogger) WithTags(tags ...interface{}) logr.Logger {
79+
// WithValues provides a new Logger with the tags appended
80+
func (l *DelegatingLogger) WithValues(tags ...interface{}) logr.Logger {
8181
if l.promise == nil {
82-
return l.Logger.WithTags(tags)
82+
return l.Logger.WithValues(tags)
8383
}
8484

8585
res := &DelegatingLogger{Logger: l.Logger}
86-
promise := l.promise.WithTags(res, tags)
86+
promise := l.promise.WithValues(res, tags)
8787
res.promise = promise
8888

8989
return res

pkg/runtime/log/log.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ package log
55
import (
66
"log"
77

8-
"github.com/thockin/logr"
9-
"github.com/thockin/logr/impls/zaplogr"
10-
tlogr "github.com/thockin/logr/testing"
8+
"github.com/go-logr/logr"
9+
tlogr "github.com/go-logr/logr/testing"
10+
"github.com/go-logr/zapr"
1111
"go.uber.org/zap"
1212
)
1313

pkg/runtime/log/log_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ package log
1919
import (
2020
"fmt"
2121

22+
tlogr "github.com/go-logr/logr/testing"
2223
. "github.com/onsi/ginkgo"
2324
. "github.com/onsi/gomega"
24-
tlogr "github.com/thockin/logr/testing"
2525
)
2626

2727
var _ = Describe("runtime log", func() {
@@ -30,9 +30,9 @@ var _ = Describe("runtime log", func() {
3030
It("shoud set and fulfill with logger", func() {
3131
logger := ZapLogger(false)
3232
Expect(logger).NotTo(BeNil())
33-
Log.WithName("runtimeLog").WithTags("newtag", "newvalue")
33+
Log.WithName("runtimeLog").WithValues("newtag", "newvalue")
3434
SetLogger(logger)
35-
logger.WithName("runtimeLog").WithTags("newtag", "newvalue")
35+
logger.WithName("runtimeLog").WithValues("newtag", "newvalue")
3636
Expect(Log.promise).To(BeNil())
3737
Expect(Log.Logger).To(Equal(logger))
3838
devLogger := ZapLogger(true)
@@ -53,11 +53,11 @@ var _ = Describe("runtime log", func() {
5353
It("should delegate with tags", func() {
5454
tags := []interface{}{"new", "tags"}
5555
test := tlogr.NullLogger{}
56-
test.WithTags(tags)
56+
test.WithValues(tags)
5757
Log = &DelegatingLogger{
5858
Logger: tlogr.NullLogger{},
5959
}
60-
Log.WithTags(tags)
60+
Log.WithValues(tags)
6161
Expect(Log.Logger).To(Equal(test))
6262
})
6363
})

vendor/github.com/go-logr/logr/examples/tab_logger.go

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/go-logr/logr/examples/usage_example.go

Lines changed: 149 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)