aboutsummaryrefslogtreecommitdiffstats
path: root/peer.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-06-14 21:44:13 +0800
committerobscuren <geffobscura@gmail.com>2014-06-14 21:44:13 +0800
commit6d52da58d9337b786a0c869974daa91ce0e34a98 (patch)
tree3efe1b3af6cad5bcd09d0868df64d2ad633eaab8 /peer.go
parent63883bf27d8b87f601e1603e9024a279b91bffb7 (diff)
downloadgo-tangerine-6d52da58d9337b786a0c869974daa91ce0e34a98.tar
go-tangerine-6d52da58d9337b786a0c869974daa91ce0e34a98.tar.gz
go-tangerine-6d52da58d9337b786a0c869974daa91ce0e34a98.tar.bz2
go-tangerine-6d52da58d9337b786a0c869974daa91ce0e34a98.tar.lz
go-tangerine-6d52da58d9337b786a0c869974daa91ce0e34a98.tar.xz
go-tangerine-6d52da58d9337b786a0c869974daa91ce0e34a98.tar.zst
go-tangerine-6d52da58d9337b786a0c869974daa91ce0e34a98.zip
Logging mechanism
Diffstat (limited to 'peer.go')
-rw-r--r--peer.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/peer.go b/peer.go
index 9da2ed002..56dd18c65 100644
--- a/peer.go
+++ b/peer.go
@@ -244,6 +244,8 @@ func (p *Peer) writeMessage(msg *ethwire.Msg) {
}
}
+ ethutil.Config.Log.Println(ethutil.LogLevelSystem, "<=", msg.Type, msg.Data)
+
err := ethwire.WriteMessage(p.conn, msg)
if err != nil {
ethutil.Config.Log.Debugln("[PEER] Can't send message:", err)
@@ -264,6 +266,7 @@ out:
select {
// Main message queue. All outbound messages are processed through here
case msg := <-p.outputQueue:
+
p.writeMessage(msg)
p.lastSend = time.Now()
@@ -316,6 +319,8 @@ func (p *Peer) HandleInbound() {
ethutil.Config.Log.Debugln(err)
}
for _, msg := range msgs {
+ ethutil.Config.Log.Println(ethutil.LogLevelSystem, "=>", msg.Type, msg.Data)
+
switch msg.Type {
case ethwire.MsgHandshakeTy:
// Version message