[core] Add more debugging for eventsub subscriptions

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2022-12-24 17:13:13 +01:00
parent 30c2246f25
commit facd2e7b91
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

View file

@ -324,6 +324,11 @@ func (e *EventSubClient) PreFetchSubscriptions(ctx context.Context) error {
return errors.Wrap(err, "hashing condition") 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}, "::") cacheKey := strings.Join([]string{sub.Type, condHash}, "::")
e.subscriptions[cacheKey] = &registeredSubscription{ e.subscriptions[cacheKey] = &registeredSubscription{
Type: sub.Type, Type: sub.Type,
@ -363,6 +368,11 @@ func (e *EventSubClient) RegisterEventSubHooks(event string, condition EventSubC
return func() { e.unregisterCallback(cacheKey, cbKey) }, nil return func() { e.unregisterCallback(cacheKey, cbKey) }, nil
} }
log.WithFields(log.Fields{
"condition": condition,
"type": event,
}).Debug("registering new eventsub subscription")
// Register subscriptions // Register subscriptions
ctx, cancel := context.WithTimeout(context.Background(), twitchRequestTimeout) ctx, cancel := context.WithTimeout(context.Background(), twitchRequestTimeout)
defer cancel() defer cancel()