Skip to content

Commit

Permalink
refactor(cloudevents-server): add debug log to diagnose the devbuild …
Browse files Browse the repository at this point in the history
…issue (#136)

Signed-off-by: wuhuizuo <wuhuizuo@126.com>

Signed-off-by: wuhuizuo <wuhuizuo@126.com>
  • Loading branch information
wuhuizuo committed Apr 23, 2024
1 parent 8d08984 commit 454154d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cloudevents-server/pkg/events/custom/tibuild/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/cloudevents/sdk-go/v2/client"
"github.com/rs/zerolog/log"
tektoncloudevent "github.com/tektoncd/pipeline/pkg/reconciler/events/cloudevent"

"github.com/PingCAP-QE/ee-apps/cloudevents-server/pkg/events/handler"
Expand Down Expand Up @@ -61,6 +62,11 @@ type routeHandler struct {

// Handle routes the given event to the specified sink URL using the CloudEvents SDK.
func (h *routeHandler) Handle(event cloudevents.Event) cloudevents.Result {
log.Debug().
Str("sink-url", h.sinkURL).
Str("ce-type", event.Type()).
Any("detail", event).
Msg("Send to sinker")
return h.client.Send(context.Background(), event)
}

Expand Down

0 comments on commit 454154d

Please sign in to comment.