diff options
Diffstat (limited to 'hsm-web/Main.hs')
-rw-r--r-- | hsm-web/Main.hs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/hsm-web/Main.hs b/hsm-web/Main.hs index 9eef1e7..d1a9da3 100644 --- a/hsm-web/Main.hs +++ b/hsm-web/Main.hs @@ -1,7 +1,20 @@ +{-# LANGUAGE TemplateHaskell #-} + import Effectful (runEff) import Hsm.Cam (runCam) -import Hsm.Log (Severity(Info), runLogs) +import Hsm.Log (Severity(Info), runLogsOpt) +import Hsm.Log.Options (makeLoggerOptionParser) import Hsm.Web (runServer, runWeb) +-- Import full module for cleaner `-ddump-splices` output +-- Avoids package/module qualifiers in generated code +import Options.Applicative + +type Loggers = '[ "cam", "libcamera", "scotty", "web"] + +$(makeLoggerOptionParser @Loggers "Options" "parser" 'Info) + main :: IO () -main = runEff . runLogs @'[ "cam", "libcamera", "scotty", "web"] Info . runCam . runWeb $ runServer +main = do + opt <- execParser . info (parser <**> helper) $ fullDesc <> progDesc "Launch HsMouse Web Server" + runEff . runLogsOpt @Options @Loggers opt . runCam . runWeb $ runServer |