From 00e4b2f8595f9689202801b5d2247c826ebfbcc2 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 25 Jul 2021 13:42:38 +0200 Subject: [PATCH] Log the index of the configuration which failed to initialize Signed-off-by: Knut Ahlers --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a1272fc..ea5efae 100644 --- a/main.go +++ b/main.go @@ -64,8 +64,11 @@ func main() { discord.Identify.Intents = discordgo.IntentsAll var enabledModules int - for _, mc := range config.ModuleConfigs { - logger := log.WithField("module", mc.Type) + for i, mc := range config.ModuleConfigs { + logger := log.WithFields(log.Fields{ + "idx": i, + "module": mc.Type, + }) mod := GetModuleByName(mc.Type) if mod == nil { logger.Fatal("Found configuration for unsupported module")