From 940d775c32c6f876f25b4f289047cfe028c384e7 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 1 May 2018 12:23:20 +0200 Subject: [PATCH] Log ovs dump-flows at 5, not 4 Most dump-flows calls are part of health checks and don't normally need to be logged about unless they fail. --- pkg/util/ovs/ovs.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/util/ovs/ovs.go b/pkg/util/ovs/ovs.go index b3b4d6abbece..a48df4377cb5 100644 --- a/pkg/util/ovs/ovs.go +++ b/pkg/util/ovs/ovs.go @@ -139,8 +139,12 @@ func New(execer exec.Interface, bridge string, minVersion string) (Interface, er } func (ovsif *ovsExec) execWithStdin(cmd string, stdinArgs []string, args ...string) (string, error) { + logLevel := glog.Level(4) switch cmd { case OVS_OFCTL: + if args[0] == "dump-flows" { + logLevel = glog.Level(5) + } args = append([]string{"-O", "OpenFlow13"}, args...) case OVS_VSCTL: args = append([]string{"--timeout=30"}, args...) @@ -152,9 +156,9 @@ func (ovsif *ovsExec) execWithStdin(cmd string, stdinArgs []string, args ...stri stdin := bytes.NewBufferString(stdinString) kcmd.SetStdin(stdin) - glog.V(4).Infof("Executing: %s %s <<\n%s", cmd, strings.Join(args, " "), stdinString) + glog.V(logLevel).Infof("Executing: %s %s <<\n%s", cmd, strings.Join(args, " "), stdinString) } else { - glog.V(4).Infof("Executing: %s %s", cmd, strings.Join(args, " ")) + glog.V(logLevel).Infof("Executing: %s %s", cmd, strings.Join(args, " ")) } output, err := kcmd.CombinedOutput()