vegapokerbot/internal/logger/default.go

17 lines
251 B
Go
Raw Permalink Normal View History

2024-05-07 21:49:09 +03:00
package logger
import (
"go.uber.org/zap"
)
func NewLogger(debug bool) (*zap.SugaredLogger, error) {
log, err := zap.NewProduction()
if debug {
log, err = zap.NewDevelopment()
}
if err != nil {
return nil, err
}
return log.Sugar(), nil
}