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