2022-08-10 11:36:30 +00:00
|
|
|
package drift
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/jedib0t/go-pretty/v6/table"
|
2022-08-22 18:12:26 +00:00
|
|
|
|
|
|
|
"github.com/c9s/bbgo/pkg/dynamic"
|
2022-09-27 11:26:59 +00:00
|
|
|
"github.com/c9s/bbgo/pkg/style"
|
2022-08-10 11:36:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (s *Strategy) Print(f io.Writer, pretty bool, withColor ...bool) {
|
2022-09-27 11:26:59 +00:00
|
|
|
var tableStyle *table.Style
|
2022-08-10 11:36:30 +00:00
|
|
|
if pretty {
|
2022-09-27 11:26:59 +00:00
|
|
|
tableStyle = style.NewDefaultTableStyle()
|
2022-08-10 11:36:30 +00:00
|
|
|
}
|
2022-09-27 11:26:59 +00:00
|
|
|
dynamic.PrintConfig(s, f, tableStyle, len(withColor) > 0 && withColor[0], dynamic.DefaultWhiteList()...)
|
2022-08-10 11:36:30 +00:00
|
|
|
}
|