fix klog 'no such flag -logtostderr' with InitFlags

pull/9480/head
Predrag Rogic 2020-10-17 00:59:05 +01:00
parent 2977a4b1cb
commit 2c1efe857a
No known key found for this signature in database
GPG Key ID: F1FF5748C4855229
1 changed files with 2 additions and 1 deletions

View File

@ -127,9 +127,10 @@ func (p *Patch) apply(data interface{}) (changed bool, err error) {
}
func main() {
klog.InitFlags(nil)
// write log statements to stderr instead of to files
if err := flag.Set("logtostderr", "true"); err != nil {
fmt.Printf("Error setting 'logtostderr' klog flag: %v", err)
fmt.Printf("Error setting 'logtostderr' klog flag: %v\n", err)
}
flag.Parse()
defer klog.Flush()