Skip to content

Commit

Permalink
fix logging errors
Browse files Browse the repository at this point in the history
Signed-off-by: Giovanni Liva <[email protected]>
  • Loading branch information
thisthat committed Aug 9, 2023
1 parent d775de9 commit 36c83cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lifecycle-operator/controllers/common/eventsender.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (e *EventMultiplexer) register(emitter IEvent) {

func (e *EventMultiplexer) Emit(phase apicommon.KeptnPhaseType, eventType string, reconcileObject client.Object, status string, message string, version string) {
for _, emitter := range e.emitters {
e.logger.Info("Emitting event using %T", emitter)
e.logger.Info(fmt.Sprintf("Emitting event using %T", emitter))
emitter.Emit(phase, eventType, reconcileObject, status, message, version)
}
}
Expand All @@ -67,7 +67,7 @@ func (e *cloudEvent) Emit(phase apicommon.KeptnPhaseType, eventType string, reco
if endpoint == "" {
// if no endpoint is configured we don't emit any event
if !strings.HasPrefix(endpoint, "http") {
e.logger.V(5).Info("CloudEvent endpoint configured but it does not start with http: %s", endpoint)
e.logger.V(5).Info(fmt.Sprintf("CloudEvent endpoint configured but it does not start with http: %s", endpoint))
}
return
}
Expand All @@ -82,13 +82,13 @@ func (e *cloudEvent) Emit(phase apicommon.KeptnPhaseType, eventType string, reco
"version": version,
})
if err != nil {
e.logger.V(5).Info("Failed to set data for CloudEvent: %v", err)
e.logger.V(5).Info(fmt.Sprintf("Failed to set data for CloudEvent: %v", err))
return
}

ctx := ce.ContextWithTarget(context.TODO(), endpoint)
if result := e.client.Send(ctx, event); ce.IsUndelivered(result) {
e.logger.V(5).Info("Failed to send CloudEvent: %v", event)
e.logger.V(5).Info(fmt.Sprintf("Failed to send CloudEvent: %v", event))
}
}

Expand Down

0 comments on commit 36c83cc

Please sign in to comment.