Enhance logging for starting
This commit is contained in:
parent
8eb44f2544
commit
9d3c5ab7b1
1 changed files with 8 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue