fix klog 'no such flag -logtostderr' with InitFlags
parent
2977a4b1cb
commit
2c1efe857a
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue