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:
Patrick Ohly 2023-01-25 08:49:05 +01:00
parent 0a38a5e68a
commit 74885d1a1d

View File

@ -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.")
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
// second example could be detected via static code analysis.