Skip to content

Commit

Permalink
⚠️ Increase log levels for controller info and errors
Browse files Browse the repository at this point in the history
Reconciliation errors are going to be logged only if V >= 3,
while success reconciliations are set for V >= 5.

Signed-off-by: Vince Prignano <vincepri@vmware.com>
  • Loading branch information
vincepri committed Aug 3, 2020
1 parent ef57964 commit b820e3a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/internal/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ func (c *Controller) reconcileHandler(obj interface{}) bool {
// resource to be synced.
if result, err := c.Do.Reconcile(req); err != nil {
c.Queue.AddRateLimited(req)
log.Error(err, "Reconciler error")
if log.V(3).Enabled() {
log.Error(err, "Reconciler error")
}
ctrlmetrics.ReconcileErrors.WithLabelValues(c.Name).Inc()
ctrlmetrics.ReconcileTotal.WithLabelValues(c.Name, "error").Inc()
return false
Expand All @@ -257,9 +259,7 @@ func (c *Controller) reconcileHandler(obj interface{}) bool {
// get queued again until another change happens.
c.Queue.Forget(obj)

// TODO(directxman12): What does 1 mean? Do we want level constants? Do we want levels at all?
log.V(1).Info("Successfully Reconciled")

log.V(5).Info("Successfully Reconciled")
ctrlmetrics.ReconcileTotal.WithLabelValues(c.Name, "success").Inc()
// Return true, don't take a break
return true
Expand Down

0 comments on commit b820e3a

Please sign in to comment.