Skip to content

Commit ff23d2d

Browse files
author
Brian Tiger Chow
committed
Merge pull request #390 from jbenet/misc/2014-11-0X
hotfix(logging) fix interpretation of peer ID in Loggable output
2 parents bad4db3 + 52631c6 commit ff23d2d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cmd/ipfs/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import (
2121
config "github.com/jbenet/go-ipfs/config"
2222
core "github.com/jbenet/go-ipfs/core"
2323
daemon "github.com/jbenet/go-ipfs/core/daemon"
24+
repo "github.com/jbenet/go-ipfs/repo"
2425
updates "github.com/jbenet/go-ipfs/updates"
2526
u "github.com/jbenet/go-ipfs/util"
2627
"github.com/jbenet/go-ipfs/util/debugerror"
2728
eventlog "github.com/jbenet/go-ipfs/util/eventlog"
28-
repo "github.com/jbenet/go-ipfs/repo"
2929
)
3030

3131
// log is the command logger
@@ -295,6 +295,7 @@ func callCommand(ctx context.Context, req cmds.Request, root *cmds.Command) (cmd
295295
return nil, err
296296
}
297297

298+
log.Info("looking for running daemon...")
298299
useDaemon, err := commandShouldRunOnDaemon(*details, req, root)
299300
if err != nil {
300301
return nil, err
@@ -383,7 +384,6 @@ func commandShouldRunOnDaemon(details cmdDetails, req cmds.Request, root *cmds.C
383384
return false, nil
384385
}
385386

386-
log.Info("looking for running daemon...")
387387
// at this point need to know whether daemon is running. we defer
388388
// to this point so that some commands dont open files unnecessarily.
389389
daemonLocked := daemon.Locked(req.Context().ConfigRoot)

peer/peer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func (p *peer) String() string {
167167
func (p *peer) Loggable() map[string]interface{} {
168168
return map[string]interface{}{
169169
p.GetType().String(): map[string]interface{}{
170-
"id": p.ID(),
170+
"id": p.ID().String(),
171171
"latency": p.GetLatency(),
172172
},
173173
}

0 commit comments

Comments
 (0)