Continue improving comments & use of structured logs

This commit is contained in:
2023-12-24 20:01:56 -06:00
parent 81e60ed4b7
commit 09f973c46a
4 changed files with 22 additions and 23 deletions

View File

@@ -63,11 +63,11 @@ func init() {
envVarSplit := strings.Split(envVar, "=")
environmentDict.Str(envVarSplit[0], envVarSplit[1])
})
log.Info().Dict("env", environmentDict).Msg("env")
if isDevelopment {
log.Logger = zerolog.New(logOut{}).With().Timestamp().Logger()
}
log.Info().Dict("env", environmentDict).Msg("env")
discordgo.Logger = func(msgL, caller int, format string, a ...interface{}) {
pc, file, line, _ := runtime.Caller(caller)
@@ -146,7 +146,7 @@ func main() {
lo.ForEach(commandDefinitions, func(cmd *discordgo.ApplicationCommand, _ int) {
arr.Str(cmd.Name)
})
log.Info().Array("commands", zerolog.Arr()).Msg("Registering commands")
log.Info().Array("commands", arr).Msg("Registering commands")
// Register commands
registeredCommands := make([]*discordgo.ApplicationCommand, len(commandDefinitions))