loggingHandler :: String                -- ^ Name of logger to use
               -> System.Log.Logger.Priority -- ^ Priority of logged messages
               -> HandlerT              -- ^ Handler to call after logging
               -> HandlerT              -- ^ Resulting handler
loggingHandler hname prio nexth socket r_sockaddr l_sockaddr = 
    do sockStr <- showSockAddr r_sockaddr
       System.Log.Logger.logM hname prio 
                   ("Received connection from " ++ sockStr)
       System.Log.Logger.traplogging hname 
               System.Log.Logger.WARNING "" (nexth socket r_sockaddr 
                                                   l_sockaddr)
       System.Log.Logger.logM hname prio
                   ("Connection " ++ sockStr ++ " disconnected")
       

-- | Handle each incoming connection in its own thread to
-- make the server multi-tasking.
loggingHandler :: String                -- ^ Name of logger to use
               -> System.Log.Logger.Priority -- ^ Priority of logged messages
               -> HandlerT              -- ^ Handler to call after logging
               -> HandlerT
loggingHandler hname prio nexth socket r_sockaddr l_sockaddr = 
    do sockStr <- showSockAddr r_sockaddr
       System.Log.Logger.logM hname prio 
                   ("Received connection from " ++ sockStr)
       System.Log.Logger.traplogging hname 
               System.Log.Logger.WARNING "" (nexth socket r_sockaddr 
                                                   l_sockaddr)
       System.Log.Logger.logM hname prio
                   ("Connection " ++ sockStr ++ " disconnected")
       

-- | Handle each incoming connection in its own thread to
-- make the server multi-tasking.
loggingHandler hname prio nexth socket r_sockaddr l_sockaddr = 
    do sockStr <- showSockAddr r_sockaddr
       System.Log.Logger.logM hname prio 
                   ("Received connection from " ++ sockStr)
       System.Log.Logger.traplogging hname 
               System.Log.Logger.WARNING "" (nexth socket r_sockaddr 
                                                   l_sockaddr)
       System.Log.Logger.logM hname prio
                   ("Connection " ++ sockStr ++ " disconnected")
       

-- | Handle each incoming connection in its own thread to
-- make the server multi-tasking.