From 2a350c6e829a326d9cf68945f8211f00aa55620d Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Wed, 3 Jul 2019 13:55:52 +0200 Subject: [PATCH] Use zap License: MIT Signed-off-by: Jakub Sztandera --- .gitignore | 1 + node/modules/lp2p/discovery.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..a8ed1beda --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +lotus diff --git a/node/modules/lp2p/discovery.go b/node/modules/lp2p/discovery.go index 8a96eff39..66111173d 100644 --- a/node/modules/lp2p/discovery.go +++ b/node/modules/lp2p/discovery.go @@ -20,11 +20,11 @@ type discoveryHandler struct { } func (dh *discoveryHandler) HandlePeerFound(p peer.AddrInfo) { - log.Warning("trying peer info: ", p) + log.Warnw("discovred peer", "peer", p) ctx, cancel := context.WithTimeout(dh.ctx, discoveryConnTimeout) defer cancel() if err := dh.host.Connect(ctx, p); err != nil { - log.Warning("Failed to connect to peer found by discovery: ", err) + log.Warnw("failed to connect to peer found by discovery", "error", err) } } @@ -43,7 +43,7 @@ func SetupDiscovery(mdns bool, mdnsInterval int) func(helpers.MetricsCtx, fx.Lif } service, err := discovery.NewMdnsService(helpers.LifecycleCtx(mctx, lc), host, time.Duration(mdnsInterval)*time.Second, discovery.ServiceTag) if err != nil { - log.Error("mdns error: ", err) + log.Errorw("mdns error", "error", err) return nil } service.RegisterNotifee(handler)