Log the index of the configuration which failed to initialize

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-07-25 13:42:38 +02:00
parent d877ce02d4
commit 00e4b2f859
Signed by: luzifer
GPG Key ID: 0066F03ED215AD7D

View File

@ -64,8 +64,11 @@ func main() {
discord.Identify.Intents = discordgo.IntentsAll discord.Identify.Intents = discordgo.IntentsAll
var enabledModules int var enabledModules int
for _, mc := range config.ModuleConfigs { for i, mc := range config.ModuleConfigs {
logger := log.WithField("module", mc.Type) logger := log.WithFields(log.Fields{
"idx": i,
"module": mc.Type,
})
mod := GetModuleByName(mc.Type) mod := GetModuleByName(mc.Type)
if mod == nil { if mod == nil {
logger.Fatal("Found configuration for unsupported module") logger.Fatal("Found configuration for unsupported module")