mirror of
https://github.com/watn3y/steamsalty.git
synced 2025-09-09 17:42:24 +02:00
v1.0
- Fixed SLEEPTIME not working (always 0) - Refined logging - Added metadata to /info command - Bot now automatically sets own commands for autocompletion
This commit is contained in:
parent
eb0482b8e0
commit
6be403fc58
14 changed files with 116 additions and 53 deletions
|
@ -2,6 +2,7 @@ package config
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
envconfig "github.com/sethvargo/go-envconfig"
|
||||
|
@ -11,12 +12,9 @@ var BotConfig config
|
|||
|
||||
func LoadConfig() {
|
||||
if err := envconfig.Process(context.Background(), &BotConfig); err != nil {
|
||||
log.Panic().Err(err).Msg("error parsing config from env variables")
|
||||
}
|
||||
|
||||
if !BotConfig.DebugMode {
|
||||
zerolog.SetGlobalLevel(zerolog.InfoLevel)
|
||||
log.Panic().Err(err).Msg("Error parsing config from env variables")
|
||||
}
|
||||
zerolog.SetGlobalLevel(zerolog.Level(BotConfig.LogLevel))
|
||||
|
||||
log.Info().Msg("Loaded config")
|
||||
log.Debug().Interface("config", BotConfig).Msg("")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue