Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Defined2014 committed Feb 22, 2024
1 parent 0e523e8 commit a6efc02
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion log.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,13 @@ func initFileLog(cfg *FileLogConfig) (*lumberjack.Logger, error) {
}

compress := false
if cfg.Compress == "gzip" {
switch cfg.Compress {
case "":
compress = false
case "gzip":
compress = true
default:
return nil, fmt.Errorf("can't set compress to `%s`", cfg.Compress)
}

// use lumberjack to logrotate
Expand Down

0 comments on commit a6efc02

Please sign in to comment.