Browse Source

Remoted bytes from logging messages

pull/57/head
Jae Kwon 10 years ago
parent
commit
df026f64fa
3 changed files with 7 additions and 3 deletions
  1. +4
    -0
      cmd/barak/main.go
  2. +2
    -2
      consensus/reactor.go
  3. +1
    -1
      p2p/connection.go

+ 4
- 0
cmd/barak/main.go View File

@ -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)))


+ 2
- 2
consensus/reactor.go View File

@ -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)
}
}


+ 1
- 1
p2p/connection.go View File

@ -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]


Loading…
Cancel
Save