From facd2e7b91b81454deeea0524da3d1f3b7ba0ea9 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 24 Dec 2022 17:13:13 +0100 Subject: [PATCH] [core] Add more debugging for eventsub subscriptions Signed-off-by: Knut Ahlers --- pkg/twitch/eventsub.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/twitch/eventsub.go b/pkg/twitch/eventsub.go index 91b96cb..7009d1c 100644 --- a/pkg/twitch/eventsub.go +++ b/pkg/twitch/eventsub.go @@ -324,6 +324,11 @@ func (e *EventSubClient) PreFetchSubscriptions(ctx context.Context) error { return errors.Wrap(err, "hashing condition") } + log.WithFields(log.Fields{ + "condition": sub.Condition, + "type": sub.Type, + }).Debug("found existing eventsub subscription") + cacheKey := strings.Join([]string{sub.Type, condHash}, "::") e.subscriptions[cacheKey] = ®isteredSubscription{ Type: sub.Type, @@ -363,6 +368,11 @@ func (e *EventSubClient) RegisterEventSubHooks(event string, condition EventSubC return func() { e.unregisterCallback(cacheKey, cbKey) }, nil } + log.WithFields(log.Fields{ + "condition": condition, + "type": event, + }).Debug("registering new eventsub subscription") + // Register subscriptions ctx, cancel := context.WithTimeout(context.Background(), twitchRequestTimeout) defer cancel()