@@ -115,7 +115,6 @@ func (p *Plugin) runRules() {
115
115
116
116
// Let the result be logged at a higher verbosity level. If there is a change in status it is logged later.
117
117
glog .V (3 ).Infof ("Add check result %+v for rule %+v" , result , rule )
118
- glog .Infof ("Ran rule %+v" , rule )
119
118
}(rule )
120
119
}
121
120
@@ -219,12 +218,13 @@ func (p *Plugin) run(rule cpmtypes.CustomRule) (exitStatus cpmtypes.Status, outp
219
218
exitCode := cmd .ProcessState .Sys ().(syscall.WaitStatus ).ExitStatus ()
220
219
switch exitCode {
221
220
case 0 :
221
+ logPluginStderr (rule , string (stderr ), 3 )
222
222
return cpmtypes .OK , output
223
223
case 1 :
224
- logPluginStderr (rule . Path , string (stderr ))
224
+ logPluginStderr (rule , string (stderr ), 0 )
225
225
return cpmtypes .NonOK , output
226
226
default :
227
- logPluginStderr (rule . Path , string (stderr ))
227
+ logPluginStderr (rule , string (stderr ), 0 )
228
228
return cpmtypes .Unknown , output
229
229
}
230
230
}
@@ -234,9 +234,9 @@ func (p *Plugin) Stop() {
234
234
glog .Info ("Stop plugin execution" )
235
235
}
236
236
237
- func logPluginStderr (path , logs string ) {
237
+ func logPluginStderr (rule cpmtypes. CustomRule , logs string , logLevel glog. Level ) {
238
238
if len (logs ) != 0 {
239
- glog .Infof ("Start logs from plugin %q \n %s" , path , string ( logs ) )
240
- glog .Infof ("End logs from plugin %q " , path )
239
+ glog .V ( logLevel ). Infof ("Start logs from plugin %+v \n %s" , rule , logs )
240
+ glog .V ( logLevel ). Infof ("End logs from plugin %+v " , rule )
241
241
}
242
242
}
0 commit comments