Set glog level. TODO: mikebrow remove this klog inititialization func once we are no longer vendoring k8s.io/klog
()
| 175 | // Set glog level. |
| 176 | // TODO: mikebrow remove this klog inititialization func once we are no longer vendoring k8s.io/klog |
| 177 | func setGLogLevel() error { |
| 178 | l := log.GetLevel() |
| 179 | fs := flag.NewFlagSet("klog", flag.PanicOnError) |
| 180 | klog.InitFlags(fs) |
| 181 | // Opt into fixed stderrthreshold behavior (kubernetes/klog#212). |
| 182 | if err := fs.Set("legacy_stderr_threshold_behavior", "false"); err != nil { |
| 183 | return err |
| 184 | } |
| 185 | if err := fs.Set("stderrthreshold", "INFO"); err != nil { |
| 186 | return err |
| 187 | } |
| 188 | if err := fs.Set("logtostderr", "true"); err != nil { |
| 189 | return err |
| 190 | } |
| 191 | switch l { |
| 192 | case log.TraceLevel: |
| 193 | return fs.Set("v", "5") |
| 194 | case log.DebugLevel: |
| 195 | return fs.Set("v", "4") |
| 196 | case log.InfoLevel: |
| 197 | return fs.Set("v", "2") |
| 198 | default: |
| 199 | // glog doesn't support other filters. Defaults to v=0. |
| 200 | } |
| 201 | return nil |
| 202 | } |
| 203 | |
| 204 | func configMigration(ctx context.Context, configVersion int, pluginConfigs map[string]any) error { |
| 205 | if configVersion >= version.ConfigVersion { |
no test coverage detected
searching dependent graphs…