Skip to content

Commit

Permalink
Log ovs dump-flows at 5, not 4
Browse files Browse the repository at this point in the history
Most dump-flows calls are part of health checks and don't normally
need to be logged about unless they fail.
  • Loading branch information
danwinship committed May 23, 2018
1 parent e5cfa25 commit 940d775
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/util/ovs/ovs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand All @@ -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()
Expand Down

0 comments on commit 940d775

Please sign in to comment.