Skip to content

Commit

Permalink
🐛 Print logger's error to stderr if given io.writer failed (#1299)
Browse files Browse the repository at this point in the history
Co-authored-by: Sepehr Rafiee <sepehr.rafiee@snapp.cab>
  • Loading branch information
cep-ter and cep-ter committed Apr 25, 2021
1 parent 3b9f78a commit a95e371
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func New(config ...Config) fiber.Handler {
// Write error to output
if _, err := cfg.Output.Write([]byte(err.Error())); err != nil {
// There is something wrong with the given io.Writer
// TODO: What should we do here?
fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
}
}
mu.Unlock()
Expand Down

0 comments on commit a95e371

Please sign in to comment.