improves logging

This commit is contained in:
Keagan McClelland
2021-09-28 17:59:28 -06:00
parent bcc3f01086
commit 0da59d225d
8 changed files with 66 additions and 6 deletions

View File

@@ -291,9 +291,9 @@ startWeb foundation = do
where
startWeb' app = (`onException` (appStopFsNotify foundation)) $ do
let AppSettings {..} = appSettings foundation
putStrLn @Text $ "Launching Tor Web Server on port " <> show torPort
runLog $ $logInfo $ "Launching Tor Web Server on port " <> show torPort
torAction <- async $ runSettings (warpSettings torPort foundation) app
putStrLn @Text $ "Launching Web Server on port " <> show appPort
runLog $ $logInfo $ "Launching Web Server on port " <> show appPort
action <- if sslAuto
then async $ runTLS (tlsSettings sslCertLocation sslKeyLocation) (warpSettings appPort foundation) app
else async $ runSettings (warpSettings appPort foundation) app
@@ -316,6 +316,7 @@ startWeb foundation = do
putMVar (appShouldRestartWeb foundation) False
putStrLn @Text "Restarting Web Server"
startWeb' app
runLog a = runLoggingT a (messageLoggerSource foundation (appLogger foundation))
restartWeb :: RegistryCtx -> IO ()
restartWeb foundation = do