logging changes
This commit is contained in:
parent
be0cc403b9
commit
02c9f2af6b
14 changed files with 96 additions and 77 deletions
|
@ -28,8 +28,8 @@ func LoadConfig() {
|
|||
zerolog.SetGlobalLevel(zerolog.InfoLevel)
|
||||
}
|
||||
|
||||
log.Info().Msg("loaded config file")
|
||||
log.Debug().Interface("config", BotConfig).Msg("")
|
||||
log.Info().Msg("Loaded config")
|
||||
log.Trace().Interface("config", BotConfig).Msg("")
|
||||
|
||||
}
|
||||
|
||||
|
@ -78,16 +78,16 @@ func EncodeToml() {
|
|||
|
||||
f, err := os.Create("data/config.toml.example")
|
||||
if err != nil {
|
||||
log.Panic().Err(err).Msg("error encoding config file. Cannot open data/config.toml.example")
|
||||
log.Panic().Err(err).Msg("Error encoding Config File. Cannot open data/config.toml.example")
|
||||
}
|
||||
|
||||
if err := toml.NewEncoder(f).Encode(exampleConfig); err != nil {
|
||||
log.Panic().Err(err).Msg("error encoding config file")
|
||||
log.Panic().Err(err).Msg("Error encoding Config File")
|
||||
}
|
||||
if err := f.Close(); err != nil {
|
||||
log.Panic().Err(err).Msg("error encoding config file. Cannot close data/config.toml.example")
|
||||
log.Panic().Err(err).Msg("Error encoding Config File. Cannot close data/config.toml.example")
|
||||
|
||||
}
|
||||
|
||||
log.Info().Msg("Wrote example config to data/config.toml.example. Bye Bye")
|
||||
log.Info().Msg("Writing example config to data/config.toml.example. Bye Bye")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue