summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs13
-rw-r--r--src/Main/Config.hs1
2 files changed, 10 insertions, 4 deletions
diff --git a/src/Main.hs b/src/Main.hs
index a2755e0..ef7710f 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -48,10 +48,12 @@ import Data.Attoparsec.ByteString.Char8 (decimal, endOfInput, parseOnly)
import qualified Data.ByteString.Char8 as BS8
import qualified Data.ByteString.Lazy as LBS
import Data.List (isInfixOf)
+import Data.Monoid
import Main.Config
import Main.Util
-import Network.Wai.Handler.Warp (run)
import Network.Wai
+import Network.Wai.Handler.Warp (run)
+import Network.Wai.Middleware.RequestLogger (logStdout)
import System.FilePath
import System.IO.Error
@@ -75,9 +77,12 @@ main =
-- | Run the application with the given configuration.
start :: Config -> IO ()
-start c =
- run (httpPort c) $ \req ->
- resourceHandler (requestResource c req) req
+start c = do
+ putStrLn $ "run cgserver with " <> show c
+ run (httpPort c)
+ $ logStdout
+ $ \req ->
+ resourceHandler (requestResource c req) req
-- | Determine which request is requested.
diff --git a/src/Main/Config.hs b/src/Main/Config.hs
index 45fa50f..9639faa 100644
--- a/src/Main/Config.hs
+++ b/src/Main/Config.hs
@@ -22,6 +22,7 @@ data Config = Config
{ cgroupRoot :: FilePath
, httpPort :: Port
}
+ deriving Show
-- |