Rather use log.Errorw instead of log.Fatalw if logger fails to sync

This commit is contained in:
lyx0 2023-12-26 18:10:44 +01:00
parent cabb0d2783
commit eda759a437

View file

@ -54,7 +54,7 @@ func main() {
logger := zap.NewExample() logger := zap.NewExample()
defer func() { defer func() {
if err := logger.Sync(); err != nil { if err := logger.Sync(); err != nil {
logger.Sugar().Fatalw("error syncing logger", logger.Sugar().Errorw("error syncing logger",
"error", err, "error", err,
) )
} }