There was an error while loading. Please reload this page.
1 parent 73edc08 commit 33395e1Copy full SHA for 33395e1
1 file changed
cmd/server/main.go
@@ -40,7 +40,11 @@ import (
40
// @name X-Bot-Token
41
func main() {
42
// Setup structured logging
43
- slog.SetDefault(slog.New(slog.NewJSONHandler(os.Stdout, nil)))
+ level := slog.LevelInfo
44
+ if os.Getenv("ENV") == "development" || os.Getenv("ENV") == "staging" || os.Getenv("ENV") == "" {
45
+ level = slog.LevelDebug
46
+ }
47
+ slog.SetDefault(slog.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{Level: level})))
48
49
// Load configuration
50
cfg, err := config.Load()
0 commit comments