vegapokerbot/internal/logger/default.go
2024-05-07 21:49:09 +03:00

17 lines
251 B
Go

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
}