diff options
Diffstat (limited to 'hsm-web')
| -rw-r--r-- | hsm-web/Hsm/Web.hs | 6 | ||||
| -rw-r--r-- | hsm-web/Main.hs | 6 | 
2 files changed, 6 insertions, 6 deletions
diff --git a/hsm-web/Hsm/Web.hs b/hsm-web/Hsm/Web.hs index b8f8881..8c0284c 100644 --- a/hsm-web/Hsm/Web.hs +++ b/hsm-web/Hsm/Web.hs @@ -20,7 +20,7 @@ import Effectful.Dispatch.Static  import Effectful.Dispatch.Static.Primitive (Env)  import Effectful.Exception (finally)  import Hsm.Cam (Cam, capturePng) -import Hsm.Log (Log, Severity (Info, Trace), logMsg, makeLoggerIO) +import Hsm.Log (Log, Logs, Severity (Info, Trace), logMsg, makeLoggerIO)  import Network.Wai.Handler.Warp (defaultSettings, setLogger)  import Paths_hsm_web (getDataFileName)  import Web.Scotty (Options (settings, verbose), defaultOptions, file, get, liftIO, raw, scottyOpts, setHeader) @@ -41,7 +41,7 @@ server options env = do        setHeader "Content-Type" "image/png"        liftIO (unEff capturePng env) >>= raw -runServer :: (Cam :> es, Log "cam" :> es, Log "web" :> es, Web :> es) => Eff es () +runServer :: (Cam :> es, Logs '["cam", "web"] es, Web :> es) => Eff es ()  runServer = finally startServer stopServer    where      startServer = do @@ -50,7 +50,7 @@ runServer = finally startServer stopServer        unsafeEff $ server options      stopServer = logMsg @"web" Info "Stopping scotty web server" -runWeb :: (IOE :> es, Log "scotty" :> es, Log "web" :> es) => Eff (Web : es) a -> Eff es a +runWeb :: (IOE :> es, Logs '["scotty", "web"] es) => Eff (Web : es) a -> Eff es a  runWeb action = do    logMsg @"web" Info "Registering logger for scotty web server"    scottyLogger <- makeLoggerIO @"scotty" >>= return . logRequest diff --git a/hsm-web/Main.hs b/hsm-web/Main.hs index 6cbfa31..82e07c9 100644 --- a/hsm-web/Main.hs +++ b/hsm-web/Main.hs @@ -11,9 +11,9 @@ import Hsm.Web (runServer, runWeb)  -- Avoids package/module qualifiers in generated code  import Options.Applicative -type Loggers = '["cam", "libcamera", "scotty", "web"] +type Logs = '["cam", "libcamera", "scotty", "web"] -$(makeLoggerOptionParser @Loggers "Options" "parser" 'Info) +$(makeLoggerOptionParser @Logs "Options" "parser" 'Info)  main :: IO () -main = bootstrapAppNoEcho parser "Launch HsMouse Web Server" $ \opts -> runServer & runWeb & runCam & runLogsOpt @Options @Loggers opts & runEff +main = bootstrapAppNoEcho parser "Launch HsMouse Web Server" $ \opts -> runServer & runWeb & runCam & runLogsOpt @Options @Logs opts & runEff  | 
