multi: enhance logging for debugging peer connection

This commit is contained in:
yyforyongyu
2021-12-13 03:56:20 +08:00
parent 5d9b59ac5a
commit 46050fc631
7 changed files with 42 additions and 20 deletions

View File

@@ -479,7 +479,8 @@ func (p *Brontide) Start() error {
return nil
}
peerLog.Tracef("Peer %v starting", p)
peerLog.Tracef("Peer %v starting with conn[%v->%v]", p,
p.cfg.Conn.LocalAddr(), p.cfg.Conn.RemoteAddr())
// Fetch and then load all the active channels we have with this remote
// peer from the database.

View File

@@ -521,3 +521,11 @@ func (m *mockMessageConn) ReadNextHeader() (uint32, error) {
func (m *mockMessageConn) ReadNextBody(buf []byte) ([]byte, error) {
return m.curReadMessage, nil
}
func (m *mockMessageConn) RemoteAddr() net.Addr {
return nil
}
func (m *mockMessageConn) LocalAddr() net.Addr {
return nil
}