FIX: add debug log

This commit is contained in:
kbearXD 2024-09-09 14:48:14 +08:00
parent 3cc96ff6ad
commit 129e2c438e
2 changed files with 12 additions and 0 deletions

View File

@ -405,6 +405,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)
} }