mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-03 10:32:05 +00:00
new logging
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/tendermint/tmlibs/logger"
|
||||
)
|
||||
|
||||
var log = logger.New("module", "abci-server")
|
||||
@@ -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