add trade logger

This commit is contained in:
c9s 2022-01-12 11:19:41 +08:00
parent db8a74238e
commit 6ee831e678

View File

@ -347,6 +347,11 @@ func (session *ExchangeSession) Init(ctx context.Context, environ *Environment)
}
}
// add trade logger
session.UserDataStream.OnTradeUpdate(func(trade types.Trade) {
log.Info(trade.String())
})
if viper.GetBool("debug-kline") {
session.MarketDataStream.OnKLine(func(kline types.KLine) {
log.WithField("marketData", "kline").Infof("kline: %+v", kline)