File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ func (c *customPluginMonitor) monitorLoop() {
135
135
}
136
136
glog .V (3 ).Infof ("Receive new plugin result for %s: %+v" , c .configPath , result )
137
137
status := c .generateStatus (result )
138
- glog .Infof ("New status generated: %+v" , status )
138
+ glog .V ( 3 ). Infof ("New status generated: %+v" , status )
139
139
c .statusChan <- status
140
140
case <- c .tomb .Stopping ():
141
141
c .plugin .Stop ()
@@ -263,12 +263,17 @@ func (c *customPluginMonitor) generateStatus(result cpmtypes.Result) *types.Stat
263
263
}
264
264
}
265
265
}
266
- return & types.Status {
266
+ status := & types.Status {
267
267
Source : c .config .Source ,
268
268
// TODO(random-liu): Aggregate events and conditions and then do periodically report.
269
269
Events : append (activeProblemEvents , inactiveProblemEvents ... ),
270
270
Conditions : c .conditions ,
271
271
}
272
+ // Log only if condition has changed
273
+ if len (activeProblemEvents ) != 0 || len (inactiveProblemEvents ) != 0 {
274
+ glog .Infof ("New status generated: %+v" , status )
275
+ }
276
+ return status
272
277
}
273
278
274
279
func toConditionStatus (s cpmtypes.Status ) types.ConditionStatus {
Original file line number Diff line number Diff line change @@ -107,7 +107,9 @@ func (p *Plugin) runRules() {
107
107
108
108
p .resultChan <- result
109
109
110
- glog .Infof ("Add check result %+v for rule %+v" , result , rule )
110
+ // Let the result be logged at a higher verbosity level. If there is a change in status it is logged later.
111
+ glog .V (3 ).Infof ("Add check result %+v for rule %+v" , result , rule )
112
+ glog .Infof ("Ran rule %+v" , rule )
111
113
}(rule )
112
114
}
113
115
You can’t perform that action at this time.
0 commit comments