Commit 66c69663 authored by Geoff Simmons's avatar Geoff Simmons

Improve logging -- *what* was successfully synced.

parent 3ca48ed6
......@@ -80,6 +80,19 @@ const (
Delete
)
func (t SyncType) String() string {
switch t {
case Add:
return "add"
case Update:
return "update"
case Delete:
return "delete"
default:
return "unknown sync type"
}
}
// SyncObj wraps the object for which event handlers are notified, and
// encodes the sync event. These are the objects passed into the
// queues for workers.
......
......@@ -238,10 +238,15 @@ func (worker *NamespaceWorker) next() {
defer worker.queue.Done(obj)
if err := worker.dispatch(obj); err == nil {
if ns, name, err := getNameSpace(obj); err == nil {
worker.syncSuccess(obj, "Successfully synced: %s/%s",
ns, name)
} else {
syncObj, ok := obj.(*SyncObj)
if ok {
if ns, name, err := getNameSpace(syncObj.Obj); err == nil {
worker.syncSuccess(obj,
"Successfully synced: %s %s/%s",
syncObj.Type, ns, name)
}
}
if !ok || err != nil {
worker.syncSuccess(obj, "Successfully synced")
}
worker.queue.Forget(obj)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment