mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-26 12:57:44 +08:00
perform some swarm logging
License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
parent
4cadbc1673
commit
eb46fbed82
@ -1,7 +1,9 @@
|
||||
package swarm
|
||||
|
||||
import (
|
||||
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
|
||||
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr/net"
|
||||
"github.com/jbenet/go-ipfs/util/elog"
|
||||
|
||||
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
||||
)
|
||||
@ -52,6 +54,13 @@ func resolveUnspecifiedAddresses(unspecifiedAddrs []ma.Multiaddr) ([]ma.Multiadd
|
||||
}
|
||||
}
|
||||
|
||||
log.Event(context.TODO(), "interfaceListenAddresses", func() elog.Loggable {
|
||||
var addrs []string
|
||||
for _, addr := range outputAddrs {
|
||||
addrs = append(addrs, addr.String())
|
||||
}
|
||||
return elog.Metadata{"addresses": addrs}
|
||||
}())
|
||||
log.Info("InterfaceListenAddresses:", outputAddrs)
|
||||
return outputAddrs, nil
|
||||
}
|
||||
|
||||
@ -13,12 +13,13 @@ import (
|
||||
peer "github.com/jbenet/go-ipfs/peer"
|
||||
u "github.com/jbenet/go-ipfs/util"
|
||||
ctxc "github.com/jbenet/go-ipfs/util/ctxcloser"
|
||||
"github.com/jbenet/go-ipfs/util/elog"
|
||||
|
||||
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
|
||||
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
||||
)
|
||||
|
||||
var log = u.Logger("swarm")
|
||||
var log = elog.Logger("swarm")
|
||||
|
||||
// ErrAlreadyOpen signals that a connection to a peer is already open.
|
||||
var ErrAlreadyOpen = errors.New("Error: Connection to this peer already open.")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user