Skip to content

Commit 169ff4f

Browse files
committed
log failed results at a higher verbosity level
1 parent 2f959a7 commit 169ff4f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/custompluginmonitor/plugin/plugin.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ func (p *Plugin) runRules() {
103103

104104
start := time.Now()
105105
exitStatus, message := p.run(*rule)
106-
level := 3
106+
level := glog.Level(3)
107107
if exitStatus != 0 {
108-
level = 2
108+
level = glog.Level(2)
109109
}
110110

111-
glog.V(glog.Level(level)).Infof("Rule: %+v. Start time: %v. End time: %v. Duration: %v", rule, start, time.Now(), time.Since(start))
111+
glog.V(level).Infof("Rule: %+v. Start time: %v. End time: %v. Duration: %v", rule, start, time.Now(), time.Since(start))
112112

113113
result := cpmtypes.Result{
114114
Rule: rule,
@@ -119,7 +119,7 @@ func (p *Plugin) runRules() {
119119
p.resultChan <- result
120120

121121
// Let the result be logged at a higher verbosity level. If there is a change in status it is logged later.
122-
glog.V(3).Infof("Add check result %+v for rule %+v", result, rule)
122+
glog.V(level).Infof("Add check result %+v for rule %+v", result, rule)
123123
}(rule)
124124
}
125125

0 commit comments

Comments
 (0)