xmaker: print config into bytes

This commit is contained in:
c9s 2024-11-21 12:17:51 +08:00
parent f74ea33e53
commit af71b5e4a5
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -1,11 +1,11 @@
package xmaker package xmaker
import ( import (
"bytes"
"context" "context"
"fmt" "fmt"
"io" "io"
"math" "math"
"os"
"sync" "sync"
"time" "time"
@ -387,7 +387,6 @@ func (s *Strategy) Initialize() error {
} }
} }
s.PrintConfig(os.Stdout, true, false)
return nil return nil
} }
@ -1751,6 +1750,10 @@ func (s *Strategy) CrossRun(
) error { ) error {
instanceID := s.InstanceID() instanceID := s.InstanceID()
configWriter := bytes.NewBuffer(nil)
s.PrintConfig(configWriter, true, false)
s.logger.Infof("config: %s", configWriter.String())
// configure sessions // configure sessions
sourceSession, ok := sessions[s.SourceExchange] sourceSession, ok := sessions[s.SourceExchange]
if !ok { if !ok {