mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Change disconnect log level to INFO (#1549)
* Change disconnect log level to INFO * Add disconnected log and change log levels
This commit is contained in:
parent
bee0893660
commit
9ffda2b1da
@ -89,7 +89,7 @@ func (m *Manager) handleError(err error, netConnection *netadapter.NetConnection
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
log.Debugf("Disconnecting from %s (reason: %s)", netConnection, protocolErr.Cause)
|
||||
log.Infof("Disconnecting from %s (reason: %s)", netConnection, protocolErr.Cause)
|
||||
netConnection.Disconnect()
|
||||
return
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ func newNetConnection(connection server.Connection, routerInitializer RouterInit
|
||||
}
|
||||
|
||||
netConnection.connection.SetOnDisconnectedHandler(func() {
|
||||
log.Infof("Disconnected from %s", netConnection)
|
||||
// If the disconnection came because of a network error and not because of the application layer, we
|
||||
// need to close the router as well.
|
||||
if atomic.AddUint32(&netConnection.isRouterClosed, 1) == 1 {
|
||||
|
@ -37,7 +37,7 @@ func (p *p2pServer) MessageStream(stream protowire.P2P_MessageStreamServer) erro
|
||||
// Connect connects to the given address
|
||||
// This is part of the P2PServer interface
|
||||
func (p *p2pServer) Connect(address string) (server.Connection, error) {
|
||||
log.Infof("%s Dialing to %s", p.name, address)
|
||||
log.Debugf("%s Dialing to %s", p.name, address)
|
||||
|
||||
const dialTimeout = 30 * time.Second
|
||||
ctx, cancel := context.WithTimeout(context.Background(), dialTimeout)
|
||||
|
Loading…
x
Reference in New Issue
Block a user