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
fs.StringVar(&c.Format, "logging-format", c.Format, fmt.Sprintf("Sets the log format. Permitted formats: %s.\nNon-default formats don't honor these flags: %s.\nNon-default choices are currently alpha and subject to change without warning.", formats, unsupportedFlags))
188
192
// No new log formats should be added after generation is of flag options
189
193
logRegistry.freeze()
190
194
@@ -232,13 +236,14 @@ var loggingFlags pflag.FlagSet
232
236
233
237
funcinit() {
234
238
varfs flag.FlagSet
235
-
klogflags.Init(&fs)
239
+
klog.InitFlags(&fs)
236
240
loggingFlags.AddGoFlagSet(&fs)
237
241
}
238
242
239
243
// List of logs (k8s.io/klog + k8s.io/component-base/logs) flags supported by all logging formats
240
244
varsupportedLogsFlags=map[string]struct{}{
241
245
"v": {},
246
+
// TODO: support vmodule after 1.19 Alpha
242
247
}
243
248
244
249
// unsupportedLoggingFlags lists unsupported logging flags. The normalize
@@ -263,3 +268,15 @@ func unsupportedLoggingFlags(normalizeFunc func(f *pflag.FlagSet, name string) p
263
268
})
264
269
returnallFlags
265
270
}
271
+
272
+
// unsupportedLoggingFlagNames lists unsupported logging flags by name, with
Copy file name to clipboardExpand all lines: staging/src/k8s.io/component-base/logs/logs.go
+37-11
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,16 @@ import (
27
27
28
28
"github.com/spf13/pflag"
29
29
logsapi "k8s.io/component-base/logs/api/v1"
30
-
"k8s.io/component-base/logs/klogflags"
31
30
"k8s.io/klog/v2"
32
31
)
33
32
34
-
constvmoduleUsage=" (only works for the default text log format)"
33
+
constdeprecated="will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components"
34
+
35
+
// TODO (https://github.com/kubernetes/kubernetes/issues/105310): once klog
36
+
// flags are removed, stop warning about "Non-default formats don't honor these
37
+
// flags" in config.go and instead add this remark here.
38
+
//
39
+
// const vmoduleUsage = " (only works for the default text log format)"
0 commit comments