You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, all names set via `WithNames` were concatenated with / and added to
the main message string as a `<names>: <msg>` prefix. Now klog in all of its
incarnations (internal logger in klog, klogr, textlogger) behaves like zapr and
adds a "logger" key with the names concatenated by a dot as value.
The main advantage, besides consistency, is that code which does a full string
match against some message string still works even when contextual logging is
enabled and `WithName` is used, at least as long as that code doesn't also
match all key/value pairs.
Copy file name to clipboardExpand all lines: ktesting/testinglogger_test.go
+5-5
Original file line number
Diff line number
Diff line change
@@ -216,7 +216,7 @@ func TestStop(t *testing.T) {
216
216
// have the < > markers.
217
217
//
218
218
// Full output:
219
-
// testinglogger_test.go:194] "TestStop/Sub leaked goroutine: WARNING: test kept at least one goroutine running after test completion" callstack=<
219
+
// testinglogger_test.go:194] "WARNING: test kept at least one goroutine running after test completion" logger="TestStop/Sub leaked goroutine" callstack=<
expected:=fmt.Sprintf(`testinglogger_test.go:%d] "TestStop/Sub leaked goroutine: WARNING: test kept at least one goroutine running after test completion" callstack=<
236
+
expected:=fmt.Sprintf(`testinglogger_test.go:%d] "WARNING: test kept at least one goroutine running after test completion" logger="TestStop/Sub leaked goroutine" callstack=<
237
237
>
238
-
testinglogger_test.go:%d] "TestStop/Sub leaked goroutine: simple info message"
0 commit comments