From a414a44190748f1b16259789e8ca354d08d0fbbf Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 2 Sep 2021 17:33:48 +0200 Subject: [PATCH] Log changes in Twitch meta for events Signed-off-by: Knut Ahlers --- twitchWatcher.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/twitchWatcher.go b/twitchWatcher.go index fce60b6..c1657d6 100644 --- a/twitchWatcher.go +++ b/twitchWatcher.go @@ -91,18 +91,31 @@ func (r *twitchWatcher) updateChannelFromAPI(channel string, sendUpdate bool) er } if r.ChannelStatus[channel].Category != status.Category { + log.WithFields(log.Fields{ + "channel": channel, + "category": status.Category, + }).Debug("Twitch metadata changed") go handleMessage(nil, nil, eventTypeTwitchCategoryUpdate, map[string]interface{}{ "category": status.Category, }) } if r.ChannelStatus[channel].Title != status.Title { + log.WithFields(log.Fields{ + "channel": channel, + "title": status.Title, + }).Debug("Twitch metadata changed") go handleMessage(nil, nil, eventTypeTwitchTitleUpdate, map[string]interface{}{ "title": status.Title, }) } if r.ChannelStatus[channel].IsLive != status.IsLive { + log.WithFields(log.Fields{ + "channel": channel, + "isLive": status.IsLive, + }).Debug("Twitch metadata changed") + evt := eventTypeTwitchStreamOnline if !status.IsLive { evt = eventTypeTwitchStreamOffline