diff --git a/server.go b/server.go index 0f25708..a229bfe 100644 --- a/server.go +++ b/server.go @@ -88,7 +88,7 @@ func handleServer(s *server) { go func() { if conn, err = s.listener.Accept(); err != nil { if stopping.Load() == nil { - logging.Logger.Error(fmt.Sprintf("Server: Cannot accept new connection: [%s]", err)) + logging.Logger().Error(fmt.Sprintf("Server: Cannot accept new connection: [%s]", err)) } } else { conn, err = s.sh.OnAccept(conn) @@ -124,7 +124,7 @@ func handleServer(s *server) { func handleConnection(s *server, conn net.Conn) { defer s.stopWg.Done() - logging.Logger.Debug(fmt.Sprintf("Server: Client[%s] is connected.", conn.RemoteAddr())) + logging.Logger().Debug(fmt.Sprintf("Server: Client[%s] is connected.", conn.RemoteAddr())) clientStopChan := make(chan struct{}) handleDoneChan := make(chan struct{}) go s.sh.Handle(conn, clientStopChan, handleDoneChan) @@ -137,6 +137,6 @@ func handleConnection(s *server, conn net.Conn) { case <-handleDoneChan: close(clientStopChan) conn.Close() - logging.Logger.Debug(fmt.Sprintf("Server: Client[%s] is disconnected.", conn.RemoteAddr())) + logging.Logger().Debug(fmt.Sprintf("Server: Client[%s] is disconnected.", conn.RemoteAddr())) } }