backtest: move info log suppress after sync

This commit is contained in:
c9s 2022-06-08 15:15:57 +08:00
parent 9ffed1d5b9
commit 854661bc71
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -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.