Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
eb46fbed
Commit
eb46fbed
authored
Nov 16, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perform some swarm logging
License: MIT Signed-off-by:
Brian Tiger Chow
<
brian@perfmode.com
>
parent
4cadbc16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
net/swarm/addrs.go
net/swarm/addrs.go
+9
-0
net/swarm/swarm.go
net/swarm/swarm.go
+2
-1
No files found.
net/swarm/addrs.go
View file @
eb46fbed
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
}
...
...
net/swarm/swarm.go
View file @
eb46fbed
...
...
@@ -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."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment