FIX: add debug log

This commit is contained in:
kbearXD 2024-09-09 14:48:14 +08:00 committed by lychiyu
parent 131d4b3d26
commit 2cd1de3e24
2 changed files with 12 additions and 0 deletions

View File

@ -406,6 +406,12 @@ func (session *ExchangeSession) initSymbol(ctx context.Context, environ *Environ
return fmt.Errorf("market %s is not defined", symbol) return fmt.Errorf("market %s is not defined", symbol)
} }
if environ == nil {
session.logger.Info("environment is nil")
} else {
session.logger.Infof("environment config: %+v", environ.environmentConfig)
}
disableMarketDataStore := environ.environmentConfig != nil && environ.environmentConfig.DisableMarketDataStore disableMarketDataStore := environ.environmentConfig != nil && environ.environmentConfig.DisableMarketDataStore
disableSessionTradeBuffer := environ.environmentConfig != nil && environ.environmentConfig.DisableSessionTradeBuffer disableSessionTradeBuffer := environ.environmentConfig != nil && environ.environmentConfig.DisableSessionTradeBuffer
maxSessionTradeBufferSize := 0 maxSessionTradeBufferSize := 0

View File

@ -122,6 +122,12 @@ func (trader *Trader) DisableLogging() {
} }
func (trader *Trader) Configure(userConfig *Config) error { func (trader *Trader) Configure(userConfig *Config) error {
// config environment
if userConfig.Environment != nil && trader.environment != nil {
trader.environment.environmentConfig = userConfig.Environment
}
// config risk control
if userConfig.RiskControls != nil { if userConfig.RiskControls != nil {
trader.SetRiskControls(userConfig.RiskControls) trader.SetRiskControls(userConfig.RiskControls)
} }