Skip to content

Commit f7623eb

Browse files
authored
Fix data synchronization logs (#567)
1 parent 4d65464 commit f7623eb

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

iterative/utils/logger.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ func (f *tpiFormatter) Format(entry *logrus.Entry) ([]byte, error) {
100100
}
101101

102102
func TpiLogger(d *schema.ResourceData) *logrus.Entry {
103-
logrus.SetFormatter(&tpiFormatter{})
104-
105-
return logrus.WithFields(logrus.Fields{"d": d})
103+
logger := logrus.New()
104+
logger.SetFormatter(&tpiFormatter{})
105+
return logger.WithFields(logrus.Fields{"d": d})
106106
}
107107

108108
func hideUnwantedPrefix(levelText, newPrefix, message string) string {

task/common/machine/storage.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ type StatusReport struct {
3434
Code string
3535
}
3636

37+
func init() {
38+
operations.SyncPrintf = func(format string, a ...interface{}) {
39+
logrus.Debugf(format, a...)
40+
}
41+
fs.LogPrint = func(level fs.LogLevel, text string) {
42+
logrus.Debug(text)
43+
}
44+
}
45+
3746
func Reports(ctx context.Context, remote, prefix string) ([]string, error) {
3847
remoteFileSystem, err := fs.NewFs(ctx, remote)
3948
if err != nil {

0 commit comments

Comments
 (0)