Add some logging
This commit is contained in:
parent
1e318817a4
commit
69aa82837c
|
@ -1,6 +1,6 @@
|
||||||
cabal-version: 1.12
|
cabal-version: 1.12
|
||||||
|
|
||||||
-- This file has been generated from package.yaml by hpack version 0.35.0.
|
-- This file has been generated from package.yaml by hpack version 0.35.2.
|
||||||
--
|
--
|
||||||
-- see: https://github.com/sol/hpack
|
-- see: https://github.com/sol/hpack
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ library
|
||||||
, time
|
, time
|
||||||
, uuid
|
, uuid
|
||||||
, wai
|
, wai
|
||||||
|
, wai-extra
|
||||||
, warp
|
, warp
|
||||||
, websockets
|
, websockets
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
@ -91,6 +92,7 @@ executable jitsi-rooms-exe
|
||||||
, time
|
, time
|
||||||
, uuid
|
, uuid
|
||||||
, wai
|
, wai
|
||||||
|
, wai-extra
|
||||||
, warp
|
, warp
|
||||||
, websockets
|
, websockets
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
|
@ -33,6 +33,7 @@ dependencies:
|
||||||
- lifted-base
|
- lifted-base
|
||||||
- mtl
|
- mtl
|
||||||
- time
|
- time
|
||||||
|
- wai-extra
|
||||||
|
|
||||||
ghc-options:
|
ghc-options:
|
||||||
- -Wall
|
- -Wall
|
||||||
|
|
|
@ -44,7 +44,7 @@ roomDataHandler ::
|
||||||
m ResponseReceived
|
m ResponseReceived
|
||||||
roomDataHandler = do
|
roomDataHandler = do
|
||||||
newRoomData <- parseBodyOrBadRequest
|
newRoomData <- parseBodyOrBadRequest
|
||||||
liftIO $ putStrLn "Got triggered form prosody"
|
liftIO $ putStrLn "Got triggered from prosody"
|
||||||
whenM (roomStateDiffers newRoomData) $ do
|
whenM (roomStateDiffers newRoomData) $ do
|
||||||
setRoomDataState newRoomData
|
setRoomDataState newRoomData
|
||||||
broadcastUserData
|
broadcastUserData
|
||||||
|
|
|
@ -15,6 +15,7 @@ import Control.Monad.Except
|
||||||
import Network.HTTP.Types
|
import Network.HTTP.Types
|
||||||
import Network.Wai
|
import Network.Wai
|
||||||
import Network.Wai.Handler.Warp (run)
|
import Network.Wai.Handler.Warp (run)
|
||||||
|
import Network.Wai.Middleware.RequestLogger (logStdoutDev)
|
||||||
import RoomDataHandler (roomDataHandler)
|
import RoomDataHandler (roomDataHandler)
|
||||||
import State.ConnectedClientsState
|
import State.ConnectedClientsState
|
||||||
( MonadConnectedClientsRead (..),
|
( MonadConnectedClientsRead (..),
|
||||||
|
@ -165,5 +166,5 @@ runWebServer ::
|
||||||
m ()
|
m ()
|
||||||
runWebServer = do
|
runWebServer = do
|
||||||
putStrLn "http://localhost:8081/"
|
putStrLn "http://localhost:8081/"
|
||||||
runWebApp >>= liftIO . run 8081
|
runWebApp >>= liftIO . (run 8081 . logStdoutDev)
|
||||||
return ()
|
return ()
|
||||||
|
|
Loading…
Reference in a new issue