Skip to content
Snippets Groups Projects
Unverified Commit 7442f0a1 authored by Levente Pap's avatar Levente Pap Committed by GitHub
Browse files

base58 encoding in analysis client logs (#456)

parent 9039716c
Branches
Tags
No related merge requests found
package client package client
import ( import (
"encoding/hex"
"net" "net"
"strings" "strings"
"sync" "sync"
...@@ -16,6 +15,7 @@ import ( ...@@ -16,6 +15,7 @@ import (
"github.com/iotaledger/hive.go/logger" "github.com/iotaledger/hive.go/logger"
"github.com/iotaledger/hive.go/network" "github.com/iotaledger/hive.go/network"
"github.com/iotaledger/hive.go/node" "github.com/iotaledger/hive.go/node"
"github.com/mr-tron/base58"
flag "github.com/spf13/pflag" flag "github.com/spf13/pflag"
) )
...@@ -76,15 +76,15 @@ func getEventDispatchers(conn *network.ManagedConnection) *EventDispatchers { ...@@ -76,15 +76,15 @@ func getEventDispatchers(conn *network.ManagedConnection) *EventDispatchers {
Heartbeat: func(hb *packet.Heartbeat) { Heartbeat: func(hb *packet.Heartbeat) {
var out strings.Builder var out strings.Builder
for _, value := range hb.OutboundIDs { for _, value := range hb.OutboundIDs {
out.WriteString(hex.EncodeToString(value)) out.WriteString(base58.Encode(value))
} }
var in strings.Builder var in strings.Builder
for _, value := range hb.InboundIDs { for _, value := range hb.InboundIDs {
in.WriteString(hex.EncodeToString(value)) in.WriteString(base58.Encode(value))
} }
log.Debugw( log.Debugw(
"Heartbeat", "Heartbeat",
"nodeID", hex.EncodeToString(hb.OwnID), "nodeID", base58.Encode(hb.OwnID),
"outboundIDs", out.String(), "outboundIDs", out.String(),
"inboundIDs", in.String(), "inboundIDs", in.String(),
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment