Skip to content

Commit

Permalink
fix: file log level
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinB committed Sep 28, 2024
1 parent c37b310 commit a3820f6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/pkg/crawl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,20 @@ func GenerateCrawlConfig(config *config.Config) (*Crawl, error) {
logfileOutputDir = filepath.Clean(config.LogFileOutputDir)
}

var fileLogLevel slog.Level
if config.Debug {
fileLogLevel = slog.LevelDebug
} else {
fileLogLevel = slog.LevelInfo
}

// Logger
customLoggerConfig := log.Config{
FileConfig: &log.LogfileConfig{
Dir: logfileOutputDir,
Prefix: "zeno",
},
FileLevel: slog.LevelDebug,
FileLevel: fileLogLevel,
StdoutEnabled: !config.NoStdoutLogging,
StdoutLevel: slog.LevelInfo,
RotateLogFile: true,
Expand Down

0 comments on commit a3820f6

Please sign in to comment.