From 854661bc71b001080b974b14e43e2f6f9350c0df Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 8 Jun 2022 15:15:57 +0800 Subject: [PATCH] backtest: move info log suppress after sync --- pkg/cmd/backtest.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/cmd/backtest.go b/pkg/cmd/backtest.go index 58148ca20..7771d2c6a 100644 --- a/pkg/cmd/backtest.go +++ b/pkg/cmd/backtest.go @@ -127,14 +127,6 @@ var BacktestCmd = &cobra.Command{ return err } - if verboseCnt == 2 { - log.SetLevel(log.DebugLevel) - } else if verboseCnt > 0 { - log.SetLevel(log.InfoLevel) - } else { - // default mode, disable strategy logging and order executor logging - log.SetLevel(log.ErrorLevel) - } if userConfig.Backtest == nil { return errors.New("backtest config is not defined") @@ -247,6 +239,15 @@ var BacktestCmd = &cobra.Command{ } } + if verboseCnt == 2 { + log.SetLevel(log.DebugLevel) + } else if verboseCnt > 0 { + log.SetLevel(log.InfoLevel) + } else { + // default mode, disable strategy logging and order executor logging + log.SetLevel(log.ErrorLevel) + } + environ.SetStartTime(startTime) // exchangeNameStr is the session name.