mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
logs: add logger.V(5).Info example
This is relevant for unit tests where normally such output would be shown when using ktesting.
This commit is contained in:
parent
0a38a5e68a
commit
74885d1a1d
@ -47,6 +47,7 @@ func Run(ctx context.Context) {
|
|||||||
klog.TODO().Info("Now the default logger is set, but using the one from the context is still better.")
|
klog.TODO().Info("Now the default logger is set, but using the one from the context is still better.")
|
||||||
|
|
||||||
logger := klog.FromContext(ctx)
|
logger := klog.FromContext(ctx)
|
||||||
|
logger.V(5).Info("Log less important message at V=5 through context")
|
||||||
|
|
||||||
// This intentionally uses the same key/value multiple times. Only the
|
// This intentionally uses the same key/value multiple times. Only the
|
||||||
// second example could be detected via static code analysis.
|
// second example could be detected via static code analysis.
|
||||||
|
Loading…
Reference in New Issue
Block a user