Skip to content

Commit 940d775

Browse files
committed
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.
1 parent e5cfa25 commit 940d775

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/util/ovs/ovs.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,12 @@ func New(execer exec.Interface, bridge string, minVersion string) (Interface, er
139139
}
140140

141141
func (ovsif *ovsExec) execWithStdin(cmd string, stdinArgs []string, args ...string) (string, error) {
142+
logLevel := glog.Level(4)
142143
switch cmd {
143144
case OVS_OFCTL:
145+
if args[0] == "dump-flows" {
146+
logLevel = glog.Level(5)
147+
}
144148
args = append([]string{"-O", "OpenFlow13"}, args...)
145149
case OVS_VSCTL:
146150
args = append([]string{"--timeout=30"}, args...)
@@ -152,9 +156,9 @@ func (ovsif *ovsExec) execWithStdin(cmd string, stdinArgs []string, args ...stri
152156
stdin := bytes.NewBufferString(stdinString)
153157
kcmd.SetStdin(stdin)
154158

155-
glog.V(4).Infof("Executing: %s %s <<\n%s", cmd, strings.Join(args, " "), stdinString)
159+
glog.V(logLevel).Infof("Executing: %s %s <<\n%s", cmd, strings.Join(args, " "), stdinString)
156160
} else {
157-
glog.V(4).Infof("Executing: %s %s", cmd, strings.Join(args, " "))
161+
glog.V(logLevel).Infof("Executing: %s %s", cmd, strings.Join(args, " "))
158162
}
159163

160164
output, err := kcmd.CombinedOutput()

0 commit comments

Comments
 (0)