diff --git a/ipnsfs/system.go b/ipnsfs/system.go index b1e4998b2..f69622729 100644 --- a/ipnsfs/system.go +++ b/ipnsfs/system.go @@ -12,7 +12,6 @@ package ipnsfs import ( "errors" - "fmt" "os" "sync" "time" @@ -119,7 +118,8 @@ type FSNode interface { // KeyRoot represents the root of a filesystem tree pointed to by a given keypair type KeyRoot struct { - key ci.PrivKey + key ci.PrivKey + name string // node is the merkledag node pointed to by this keypair node *dag.Node @@ -146,6 +146,7 @@ func (fs *Filesystem) newKeyRoot(parent context.Context, k ci.PrivKey) (*KeyRoot root := new(KeyRoot) root.key = k root.fs = fs + root.name = name ctx, cancel := context.WithCancel(parent) defer cancel() @@ -230,8 +231,13 @@ func (kr *KeyRoot) Publish(ctx context.Context) error { // otherwise we are holding the lock through a costly // network operation - fmt.Println("Publishing!") - return kr.fs.nsys.Publish(ctx, kr.key, path.FromKey(k)) + kp := path.FromKey(k) + + ev := &eventlog.Metadata{"name": kr.name, "key": kp} + defer log.EventBegin(ctx, "ipnsfsPublishing", ev).Done() + log.Info("ipnsfs publishing %s -> %s", kr.name, kp) + + return kr.fs.nsys.Publish(ctx, kr.key, kp) } // Republisher manages when to publish the ipns entry associated with a given key