Skip to content

Commit

Permalink
chore(cloudevents-server): add debug log
Browse files Browse the repository at this point in the history
Signed-off-by: wuhuizuo <wuhuizuo@126.com>
  • Loading branch information
wuhuizuo committed Feb 29, 2024
1 parent 04297de commit 6fa6092
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tekton

import (
"net/http"
"strings"

"github.com/PingCAP-QE/ee-apps/cloudevents-server/pkg/config"
cloudevents "github.com/cloudevents/sdk-go/v2"
Expand Down Expand Up @@ -51,6 +52,11 @@ func (h *pipelineRunHandler) Handle(event cloudevents.Event) cloudevents.Result
receivers = append(h.Receivers[defaultReceiversKey], h.Receivers[event.Type()]...)
}

log.Debug().
Str("ce-type", event.Type()).
Str("receivers", strings.Join(receivers, ",")).
Msg("send notification for the event type.")

return sendLarkMessages(h.LarkClient, receivers, event, h.DashboardBaseURL)
default:
log.Debug().Str("ce-type", event.Type()).Msg("skip notifing for the event type.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tekton

import (
"net/http"
"strings"

"github.com/PingCAP-QE/ee-apps/cloudevents-server/pkg/config"
cloudevents "github.com/cloudevents/sdk-go/v2"
Expand Down Expand Up @@ -41,6 +42,11 @@ func (h *taskRunHandler) Handle(event cloudevents.Event) cloudevents.Result {
receivers = append(h.Receivers[defaultReceiversKey], h.Receivers[event.Type()]...)
}

log.Debug().
Str("ce-type", event.Type()).
Str("receivers", strings.Join(receivers, ",")).
Msg("send notification for the event type.")

return sendLarkMessages(h.LarkClient, receivers, event, h.DashboardBaseURL)
default:
log.Debug().Str("ce-type", event.Type()).Msg("skip notifing for the event type.")
Expand Down

0 comments on commit 6fa6092

Please sign in to comment.