Browse Source

change some log.Info to log.Debug

pull/456/head
Ethan Buchman 9 years ago
parent
commit
78c9d526c3
2 changed files with 7 additions and 7 deletions
  1. +6
    -6
      connection.go
  2. +1
    -1
      switch.go

+ 6
- 6
connection.go View File

@ -196,7 +196,7 @@ func (c *MConnection) Send(chID byte, msg interface{}) bool {
return false return false
} }
log.Info("Send", "channel", chID, "conn", c, "msg", msg) //, "bytes", wire.BinaryBytes(msg))
log.Debug("Send", "channel", chID, "conn", c, "msg", msg) //, "bytes", wire.BinaryBytes(msg))
// Send message to channel. // Send message to channel.
channel, ok := c.channelsIdx[chID] channel, ok := c.channelsIdx[chID]
@ -225,7 +225,7 @@ func (c *MConnection) TrySend(chID byte, msg interface{}) bool {
return false return false
} }
log.Info("TrySend", "channel", chID, "conn", c, "msg", msg)
log.Debug("TrySend", "channel", chID, "conn", c, "msg", msg)
// Send message to channel. // Send message to channel.
channel, ok := c.channelsIdx[chID] channel, ok := c.channelsIdx[chID]
@ -277,12 +277,12 @@ FOR_LOOP:
channel.updateStats() channel.updateStats()
} }
case <-c.pingTimer.Ch: case <-c.pingTimer.Ch:
log.Info("Send Ping")
log.Debug("Send Ping")
wire.WriteByte(packetTypePing, c.bufWriter, &n, &err) wire.WriteByte(packetTypePing, c.bufWriter, &n, &err)
c.sendMonitor.Update(int(n)) c.sendMonitor.Update(int(n))
c.flush() c.flush()
case <-c.pong: case <-c.pong:
log.Info("Send Pong")
log.Debug("Send Pong")
wire.WriteByte(packetTypePong, c.bufWriter, &n, &err) wire.WriteByte(packetTypePong, c.bufWriter, &n, &err)
c.sendMonitor.Update(int(n)) c.sendMonitor.Update(int(n))
c.flush() c.flush()
@ -411,11 +411,11 @@ FOR_LOOP:
switch pktType { switch pktType {
case packetTypePing: case packetTypePing:
// TODO: prevent abuse, as they cause flush()'s. // TODO: prevent abuse, as they cause flush()'s.
log.Info("Receive Ping")
log.Debug("Receive Ping")
c.pong <- struct{}{} c.pong <- struct{}{}
case packetTypePong: case packetTypePong:
// do nothing // do nothing
log.Info("Receive Pong")
log.Debug("Receive Pong")
case packetTypeMsg: case packetTypeMsg:
pkt, n, err := msgPacket{}, int(0), error(nil) pkt, n, err := msgPacket{}, int(0), error(nil)
wire.ReadBinaryPtr(&pkt, c.bufReader, maxMsgPacketTotalSize(), &n, &err) wire.ReadBinaryPtr(&pkt, c.bufReader, maxMsgPacketTotalSize(), &n, &err)


+ 1
- 1
switch.go View File

@ -312,7 +312,7 @@ func (sw *Switch) IsDialing(addr *NetAddress) bool {
// NOTE: Broadcast uses goroutines, so order of broadcast may not be preserved. // NOTE: Broadcast uses goroutines, so order of broadcast may not be preserved.
func (sw *Switch) Broadcast(chID byte, msg interface{}) chan bool { func (sw *Switch) Broadcast(chID byte, msg interface{}) chan bool {
successChan := make(chan bool, len(sw.peers.List())) successChan := make(chan bool, len(sw.peers.List()))
log.Info("Broadcast", "channel", chID, "msg", msg)
log.Debug("Broadcast", "channel", chID, "msg", msg)
for _, peer := range sw.peers.List() { for _, peer := range sw.peers.List() {
go func(peer *Peer) { go func(peer *Peer) {
success := peer.Send(chID, msg) success := peer.Send(chID, msg)


Loading…
Cancel
Save