Browse files

Fix logging and configuration.

  • Loading branch information...
1 parent 392d240 commit 3cca69013b8d35bf0a39c25cbf596f4810401c81 @clanehin committed Sep 15, 2012
Showing with 8 additions and 4 deletions.
  1. +4 −1 Roguestar/Lib/Logging.hs
  2. +4 −3 Roguestar/Server/Main.hs
View
5 Roguestar/Lib/Logging.hs
@@ -10,9 +10,12 @@ module Roguestar.Lib.Logging
where
import System.Log.Logger
+import System.Log.Handler.Simple
initLogging :: Priority -> IO ()
-initLogging prio = updateGlobalLogger rootLoggerName (setLevel prio)
+initLogging prio =
+ do logger <- fileHandler "log/roguestar.log" prio
+ updateGlobalLogger rootLoggerName $ setHandlers [logger]
log_creature :: String
log_creature = "lib.Creature"
View
7 Roguestar/Server/Main.hs
@@ -66,8 +66,8 @@ appInit = makeSnaplet "roguestar-server-snaplet" "Roguestar Server" Nothing $
("/options", options),
("", heistServe)]
game <- liftIO createGameState
- wrapHandlers (<|> handle404)
- wrapHandlers handle500
+ wrapSite (<|> handle404)
+ wrapSite handle500
return $ App hs game
handle500 :: MonadSnap m => m a -> m ()
@@ -415,5 +415,6 @@ instance Charcoded TerrainPatch where
main :: IO ()
main =
do initLogging WARNING
- serveSnaplet defaultConfig appInit
+ config <- commandLineConfig emptyConfig
+ serveSnaplet config appInit

0 comments on commit 3cca690

Please sign in to comment.