mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 21:01:21 +00:00
new logging
This commit is contained in:
@ -94,15 +94,15 @@ func (s *SocketServer) acceptConnectionsRoutine() {
|
||||
// semaphore <- struct{}{}
|
||||
|
||||
// Accept a connection
|
||||
log.Notice("Waiting for new connection...")
|
||||
s.Logger.Info("Waiting for new connection...")
|
||||
conn, err := s.listener.Accept()
|
||||
if err != nil {
|
||||
if !s.IsRunning() {
|
||||
return // Ignore error from listener closing.
|
||||
}
|
||||
log.Crit("Failed to accept connection: " + err.Error())
|
||||
s.Logger.Error("Failed to accept connection: " + err.Error())
|
||||
} else {
|
||||
log.Notice("Accepted a new connection")
|
||||
s.Logger.Info("Accepted a new connection")
|
||||
}
|
||||
|
||||
connID := s.addConn(conn)
|
||||
@ -119,18 +119,18 @@ func (s *SocketServer) acceptConnectionsRoutine() {
|
||||
// Wait until signal to close connection
|
||||
errClose := <-closeConn
|
||||
if err == io.EOF {
|
||||
log.Warn("Connection was closed by client")
|
||||
s.Logger.Error("Connection was closed by client")
|
||||
} else if errClose != nil {
|
||||
log.Warn("Connection error", "error", errClose)
|
||||
s.Logger.Error("Connection error", "error", errClose)
|
||||
} else {
|
||||
// never happens
|
||||
log.Warn("Connection was closed.")
|
||||
s.Logger.Error("Connection was closed.")
|
||||
}
|
||||
|
||||
// Close the connection
|
||||
err := s.rmConn(connID, conn)
|
||||
if err != nil {
|
||||
log.Warn("Error in closing connection", "error", err)
|
||||
s.Logger.Error("Error in closing connection", "error", err)
|
||||
}
|
||||
|
||||
// <-semaphore
|
||||
|
Reference in New Issue
Block a user