Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor: refactor event logging format #40

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
Loading