Skip to content

Commit

Permalink
fix(refactor): refactor event logging format.
Browse files Browse the repository at this point in the history
  • Loading branch information
narmidm authored Apr 16, 2024
2 parents 9d1b32f + 427fb5a commit 7a97eb4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ func (er *eventRecorder) RecordEvent(ctx context.Context, e *Event) error {
} else {
er.cache.Add(key, ev)
}
er.Logger.Infof("event has been created %v", ev)
er.Logger.Infof("event has been created object: %s/%s kind: %s type: %s reason %s message %s",
ev.InvolvedObject.Namespace, ev.InvolvedObject.Name, ev.InvolvedObject.Kind, ev.Type, ev.Reason, ev.Message)
} else {
// event already present in cache
e := lastSeenEvent.(*corev1.Event)
Expand All @@ -264,7 +265,8 @@ func (er *eventRecorder) RecordEvent(ctx context.Context, e *Event) error {
}
// update the cache
er.cache.Add(key, e)
er.Logger.Debugf("event has been updated %v", ev)
er.Logger.Debugf("event has been created object: %s/%s kind: %s type: %s reason %s message %s",
ev.InvolvedObject.Namespace, ev.InvolvedObject.Name, ev.InvolvedObject.Kind, ev.Type, ev.Reason, ev.Message)
}
return nil
}

0 comments on commit 7a97eb4

Please # to comment.