From 7e766a4ec04f1e0e5832010f1ed14a253d238fef Mon Sep 17 00:00:00 2001 From: Zhen Wang Date: Wed, 3 Apr 2019 13:02:45 -0700 Subject: [PATCH] Disable glog writing to files for log-counter --- cmd/logcounter/log_counter.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/logcounter/log_counter.go b/cmd/logcounter/log_counter.go index 4260ded80..672d8be25 100644 --- a/cmd/logcounter/log_counter.go +++ b/cmd/logcounter/log_counter.go @@ -17,6 +17,7 @@ limitations under the License. package main import ( + "flag" "fmt" "os" @@ -28,6 +29,12 @@ import ( ) func main() { + // Set glog flag so that it does not log to files. + if err := flag.Set("logtostderr", "true"); err != nil { + fmt.Printf("Failed to set logtostderr=true: %v", err) + os.Exit(int(types.Unknown)) + } + fedo := options.NewLogCounterOptions() fedo.AddFlags(pflag.CommandLine) pflag.Parse()