Skip to content

Commit 7e766a4

Browse files
committed
Disable glog writing to files for log-counter
1 parent 8ec3a76 commit 7e766a4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/logcounter/log_counter.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package main
1818

1919
import (
20+
"flag"
2021
"fmt"
2122
"os"
2223

@@ -28,6 +29,12 @@ import (
2829
)
2930

3031
func main() {
32+
// Set glog flag so that it does not log to files.
33+
if err := flag.Set("logtostderr", "true"); err != nil {
34+
fmt.Printf("Failed to set logtostderr=true: %v", err)
35+
os.Exit(int(types.Unknown))
36+
}
37+
3138
fedo := options.NewLogCounterOptions()
3239
fedo.AddFlags(pflag.CommandLine)
3340
pflag.Parse()

0 commit comments

Comments
 (0)