Skip to content

Commit aa66999

Browse files
committed
refactor: improve sync logging
1 parent 2952d9c commit aa66999

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pkg/devspace/sync/evaluater.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func shouldRemoveLocal(absFilepath string, fileInformation *FileInformation, s *
141141
// We don't delete the file if we haven't tracked it
142142
if stat != nil && s.fileIndex.fileMap[fileInformation.Name] != nil {
143143
if stat.IsDir() != s.fileIndex.fileMap[fileInformation.Name].IsDirectory || stat.IsDir() != fileInformation.IsDirectory {
144-
s.log.Infof("Skip %s because stat returned unequal isdir with fileMap", absFilepath)
144+
s.log.Debugf("Skip %s because stat returned unequal isdir with fileMap", absFilepath)
145145
return false
146146
}
147147

@@ -153,7 +153,7 @@ func shouldRemoveLocal(absFilepath string, fileInformation *FileInformation, s *
153153
return true
154154
}
155155

156-
s.log.Infof("Skip %s because stat.ModTime() %d is greater than fileInformation.Mtime %d", absFilepath, stat.ModTime().Unix(), fileInformation.Mtime)
156+
s.log.Debugf("Skip %s because stat.ModTime() %d is greater than fileInformation.Mtime %d", absFilepath, stat.ModTime().Unix(), fileInformation.Mtime)
157157
} else {
158158
// s.log.Infof("Skip %s because Mtime (%d and %d) or Size (%d and %d) is unequal between fileInformation and fileMap", absFilepath, fileInformation.Mtime, s.fileIndex.fileMap[fileInformation.Name].Mtime, fileInformation.Size, s.fileIndex.fileMap[fileInformation.Name].Size)
159159
return true

pkg/devspace/sync/upstream.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ func (u *upstream) evaluateChange(relativePath, fullpath string) (*FileInformati
475475
}
476476
}
477477
} else if err != nil {
478+
u.sync.log.Debugf("Error in lstat %s: %v", fullpath, err)
478479
return nil, nil
479480
} else if stat == nil {
480481
return nil, nil

0 commit comments

Comments
 (0)