From 4a8ef198d7ede307f204c1fb6f172a9cb1a009ca Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 6 Oct 2018 13:00:33 -0700 Subject: [PATCH] add logging --- weed/replication/replicator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/replication/replicator.go b/weed/replication/replicator.go index d5a57ecac..16103577f 100644 --- a/weed/replication/replicator.go +++ b/weed/replication/replicator.go @@ -35,9 +35,11 @@ func (r *Replicator) Replicate(key string, message *filer_pb.EventNotification) } key = filepath.Join(r.sink.GetSinkToDirectory(), key[len(r.source.Dir):]) if message.OldEntry != nil && message.NewEntry == nil { + glog.V(4).Infof("deleting %v", key) return r.sink.DeleteEntry(key, message.OldEntry.IsDirectory, message.DeleteChunks) } if message.OldEntry == nil && message.NewEntry != nil { + glog.V(4).Infof("creating %v", key) return r.sink.CreateEntry(key, message.NewEntry) } if message.OldEntry == nil && message.NewEntry == nil { @@ -47,8 +49,10 @@ func (r *Replicator) Replicate(key string, message *filer_pb.EventNotification) foundExisting, err := r.sink.UpdateEntry(key, message.OldEntry, message.NewEntry, message.DeleteChunks) if foundExisting { + glog.V(4).Infof("updated %v", key) return err } + glog.V(4).Infof("creating missing %v", key) return r.sink.CreateEntry(key, message.NewEntry) }