From df026f64fa9629246fda6a6440d04a42f0c130c3 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 20 Apr 2015 18:51:20 -0700 Subject: [PATCH] Remoted bytes from logging messages --- cmd/barak/main.go | 4 ++++ consensus/reactor.go | 4 ++-- p2p/connection.go | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/barak/main.go b/cmd/barak/main.go index 65229aa7c..095f53be3 100644 --- a/cmd/barak/main.go +++ b/cmd/barak/main.go @@ -79,6 +79,10 @@ func main() { if barak.rootDir == "" { barak.rootDir = os.Getenv("HOME") + "/.barak" } + err = EnsureDir(barak.rootDir) + if err != nil { + panic(Fmt("Error creating barak rootDir: %v", err)) + } // Write pid to file. err = AtomicWriteFile(barak.rootDir+"/pidfile", []byte(Fmt("%v", barak.pid))) diff --git a/consensus/reactor.go b/consensus/reactor.go index 7c3033d6e..55b62bde8 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -136,7 +136,7 @@ func (conR *ConsensusReactor) Receive(chId byte, peer *p2p.Peer, msgBytes []byte log.Warn("Error decoding message", "channel", chId, "peer", peer, "msg", msg_, "error", err, "bytes", msgBytes) return } - log.Debug("Receive", "channel", chId, "peer", peer, "msg", msg_, "bytes", msgBytes) + log.Debug("Receive", "channel", chId, "peer", peer, "msg", msg_) //, "bytes", msgBytes) switch chId { case StateChannel: @@ -295,7 +295,7 @@ func (conR *ConsensusReactor) sendNewRoundStepRoutine(peer *p2p.Peer) { peer.Send(StateChannel, nrsMsg) } if csMsg != nil { - peer.Send(StateChannel, nrsMsg) + peer.Send(StateChannel, csMsg) } } diff --git a/p2p/connection.go b/p2p/connection.go index 85d6e88ea..de2728e5c 100644 --- a/p2p/connection.go +++ b/p2p/connection.go @@ -184,7 +184,7 @@ func (c *MConnection) Send(chId byte, msg interface{}) bool { return false } - log.Debug("Send", "channel", chId, "connection", c, "msg", msg, "bytes", binary.BinaryBytes(msg)) + log.Debug("Send", "channel", chId, "connection", c, "msg", msg) //, "bytes", binary.BinaryBytes(msg)) // Send message to channel. channel, ok := c.channelsIdx[chId]