mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-13 02:23:51 +00:00
grid2: pass logger entry to debugGrid
This commit is contained in:
parent
9d218d93ac
commit
6dc92bea16
|
@ -4,12 +4,14 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/c9s/bbgo/pkg/bbgo"
|
"github.com/c9s/bbgo/pkg/bbgo"
|
||||||
"github.com/c9s/bbgo/pkg/fixedpoint"
|
"github.com/c9s/bbgo/pkg/fixedpoint"
|
||||||
"github.com/c9s/bbgo/pkg/types"
|
"github.com/c9s/bbgo/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func debugGrid(grid *Grid, book *bbgo.ActiveOrderBook) {
|
func debugGrid(logger logrus.FieldLogger, grid *Grid, book *bbgo.ActiveOrderBook) {
|
||||||
var sb strings.Builder
|
var sb strings.Builder
|
||||||
|
|
||||||
sb.WriteString("================== GRID ORDERS ==================\n")
|
sb.WriteString("================== GRID ORDERS ==================\n")
|
||||||
|
@ -50,5 +52,5 @@ func debugGrid(grid *Grid, book *bbgo.ActiveOrderBook) {
|
||||||
|
|
||||||
sb.WriteString("================== END OF GRID ORDERS ===================")
|
sb.WriteString("================== END OF GRID ORDERS ===================")
|
||||||
|
|
||||||
fmt.Println(sb.String())
|
logger.Infoln(sb.String())
|
||||||
}
|
}
|
||||||
|
|
|
@ -1223,7 +1223,7 @@ func (s *Strategy) recoverGridWithOpenOrders(ctx context.Context, historyService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
debugGrid(grid, orderBook)
|
debugGrid(s.logger, grid, orderBook)
|
||||||
|
|
||||||
tmpOrders := orderBook.Orders()
|
tmpOrders := orderBook.Orders()
|
||||||
|
|
||||||
|
@ -1272,7 +1272,7 @@ func (s *Strategy) recoverGridWithOpenOrders(ctx context.Context, historyService
|
||||||
|
|
||||||
s.logger.Infof("GRID RECOVER COMPLETE")
|
s.logger.Infof("GRID RECOVER COMPLETE")
|
||||||
|
|
||||||
debugGrid(grid, s.orderExecutor.ActiveMakerOrders())
|
debugGrid(s.logger, grid, s.orderExecutor.ActiveMakerOrders())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user