Skip to content

Commit

Permalink
Move youtube api setup after logger init
Browse files Browse the repository at this point in the history
  • Loading branch information
xoltia committed Oct 23, 2024
1 parent cf263c5 commit 01ac43e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/botsu/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ func main() {

config.LoadDefaults()

// Config is loaded, now we can set the log level
logLevel.Set(config.LogLevel)
logger.Info("Log level set", slog.String("level", config.LogLevel.String()))

if config.GoogleAPIKey != "" {
err = activities.SetupYoutubeAPI(config.GoogleAPIKey)
if err != nil {
Expand All @@ -74,10 +78,6 @@ func main() {
}
}

// Config is loaded, now we can set the log level
logLevel.Set(config.LogLevel)
logger.Info("Log level set", slog.String("level", config.LogLevel.String()))

discordgo.Logger = func(msgL, _caller int, format string, a ...interface{}) {
msg := fmt.Sprintf("[DGO] "+format, a...)

Expand Down

0 comments on commit 01ac43e

Please sign in to comment.