diff --git a/server.go b/server.go index 8474920..b3463aa 100644 --- a/server.go +++ b/server.go @@ -98,7 +98,7 @@ func handleServer(s *server) { defer s.stopWg.Done() if err := s.httpServer.Serve(s.listener); nil != err { - logging.Logger.Error(fmt.Sprintf("Server: Server err - %v", err)) + logging.Logger().Error(fmt.Sprintf("Server: Server err - %v", err)) } }() @@ -150,7 +150,7 @@ func (s *server) handleError(ctx *fasthttp.RequestCtx, status int, reason error) func handleConnection(s *server, soc *Socket, socketHandler SocketHandler) { defer s.stopWg.Done() - logging.Logger.Debug(fmt.Sprintf("Server: Client[%s] is connected.", soc.RemoteAddr())) + logging.Logger().Debug(fmt.Sprintf("Server: Client[%s] is connected.", soc.RemoteAddr())) clientStopChan := make(chan struct{}) handleDoneChan := make(chan struct{}) @@ -163,7 +163,7 @@ func handleConnection(s *server, soc *Socket, socketHandler SocketHandler) { <-handleDoneChan case <-handleDoneChan: close(clientStopChan) - logging.Logger.Debug(fmt.Sprintf("Server: Client[%s] is disconnected.", soc.RemoteAddr())) + logging.Logger().Debug(fmt.Sprintf("Server: Client[%s] is disconnected.", soc.RemoteAddr())) soc.Close() } }