max: set debug vars from env vars

This commit is contained in:
c9s 2021-06-07 23:11:53 +08:00
parent 990da5ad3b
commit a8eda62a8d

View File

@ -12,18 +12,17 @@ import (
"math"
"net/http"
"net/url"
"os"
"reflect"
"regexp"
"strconv"
"sync/atomic"
"time"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/c9s/bbgo/pkg/util"
"github.com/c9s/bbgo/pkg/version"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)
const (
@ -41,7 +40,8 @@ const (
var debugMaxRequestPayload = true
func init() {
debugMaxRequestPayload = viper.GetBool("MAX_DEBUG_REQUEST_PAYLOAD")
debugMaxRequestPayload, _ = strconv.ParseBool(os.Getenv("DEBUG_MAX_REQUEST_PAYLOAD"))
debugRequestDump, _ = strconv.ParseBool(os.Getenv("DEBUG_MAX_REQUEST"))
}
var logger = log.WithField("exchange", "max")