Skip to content

Commit

Permalink
fix: yet another log handling fix
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jul 10, 2024
1 parent a1a8563 commit 3f9102d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ func setupLog() (func() error, error) {
}
if err := os.MkdirAll(filepath.Dir(logFile), 0o644); err != nil {
// log disabled
return nil, nil
return func() error { return nil }, nil
}
f, err := os.OpenFile(logFile, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644)
if err != nil {
// log disabled
return nil, nil
return func() error { return nil }, nil
}
log.SetOutput(f)
log.SetLevel(log.DebugLevel)
Expand Down

0 comments on commit 3f9102d

Please sign in to comment.