@@ -47,19 +47,25 @@ type SyncConfig struct {
4747 upstream * upstream
4848 downstream * downstream
4949
50+ silent bool
51+
5052 // Used for testing
5153 testing bool
5254 errorChan chan error
5355}
5456
5557// Logf prints the given information to the synclog with context data
5658func (s * SyncConfig ) Logf (format string , args ... interface {}) {
57- syncLog .WithKey ("local" , s .WatchPath ).WithKey ("container" , s .DestPath ).WithKey ("excluded" , s .ExcludePaths ).Infof (format , args ... )
59+ if s .silent == false {
60+ syncLog .WithKey ("local" , s .WatchPath ).WithKey ("container" , s .DestPath ).WithKey ("excluded" , s .ExcludePaths ).Infof (format , args ... )
61+ }
5862}
5963
6064// Logln prints the given information to the synclog with context data
6165func (s * SyncConfig ) Logln (line interface {}) {
62- syncLog .WithKey ("local" , s .WatchPath ).WithKey ("container" , s .DestPath ).WithKey ("excluded" , s .ExcludePaths ).Info (line )
66+ if s .silent == false {
67+ syncLog .WithKey ("local" , s .WatchPath ).WithKey ("container" , s .DestPath ).WithKey ("excluded" , s .ExcludePaths ).Info (line )
68+ }
6369}
6470
6571// Error handles a sync error with context
@@ -334,7 +340,7 @@ func (s *SyncConfig) diffDir(filepath string, sendChanges *[]*fileInformation, d
334340
335341//Stop stops the sync process
336342func (s * SyncConfig ) Stop () {
337- if s .upstream != nil {
343+ if s .upstream != nil && s . upstream . interrupt != nil {
338344 select {
339345 case <- s .upstream .interrupt :
340346 default :
@@ -355,7 +361,7 @@ func (s *SyncConfig) Stop() {
355361 }
356362 }
357363
358- if s .downstream != nil {
364+ if s .downstream != nil && s . downstream . interrupt != nil {
359365 select {
360366 case <- s .downstream .interrupt :
361367 default :
0 commit comments