Enhance logging for starting

This commit is contained in:
1computer1 2019-07-23 01:40:45 -04:00
parent 8eb44f2544
commit 9d3c5ab7b1

View file

@ -2,9 +2,12 @@ module Myriad
( runMyriadServer
) where
import Control.Monad.Logger (runStdoutLoggingT)
import Data.String.Conversions
import qualified Data.Text as T
import Network.Wai.Handler.Warp (run)
import Network.Wai.Handler.Warp
import Myriad.Core
import Myriad.Docker
@ -17,5 +20,7 @@ runMyriadServer configInput = do
buildAllImages
startCleanup
logInfo ["Finished Docker-related setup"]
logInfo ["Starting server"]
run (fromIntegral . port . config $ env) $ app env
let myriadPort = fromIntegral . port $ config env
onReady = runStdoutLoggingT $ logInfo ["Server started on port ", cs $ show myriadPort, "!"]
settings = setPort myriadPort . setBeforeMainLoop onReady $ defaultSettings
runSettings settings $ app env