@@ -115,7 +115,6 @@ func (p *Plugin) runRules() {
115115
116116 // Let the result be logged at a higher verbosity level. If there is a change in status it is logged later.
117117 glog .V (3 ).Infof ("Add check result %+v for rule %+v" , result , rule )
118- glog .Infof ("Ran rule %+v" , rule )
119118 }(rule )
120119 }
121120
@@ -219,12 +218,13 @@ func (p *Plugin) run(rule cpmtypes.CustomRule) (exitStatus cpmtypes.Status, outp
219218 exitCode := cmd .ProcessState .Sys ().(syscall.WaitStatus ).ExitStatus ()
220219 switch exitCode {
221220 case 0 :
221+ logPluginStderr (rule , string (stderr ), 3 )
222222 return cpmtypes .OK , output
223223 case 1 :
224- logPluginStderr (rule . Path , string (stderr ))
224+ logPluginStderr (rule , string (stderr ), 0 )
225225 return cpmtypes .NonOK , output
226226 default :
227- logPluginStderr (rule . Path , string (stderr ))
227+ logPluginStderr (rule , string (stderr ), 0 )
228228 return cpmtypes .Unknown , output
229229 }
230230}
@@ -234,9 +234,9 @@ func (p *Plugin) Stop() {
234234 glog .Info ("Stop plugin execution" )
235235}
236236
237- func logPluginStderr (path , logs string ) {
237+ func logPluginStderr (rule cpmtypes. CustomRule , logs string , logLevel glog. Level ) {
238238 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 )
241241 }
242242}
0 commit comments