diff options
| author | hallgren <hallgren@chalmers.se> | 2013-01-12 18:48:23 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2013-01-12 18:48:23 +0000 |
| commit | 68c04cdd633ea48062e70720c89505b154f1b4a6 (patch) | |
| tree | c93596532ea28e0e8c68172223fac3caf5f83da1 /src | |
| parent | b0228af26d9be83fda956c319b2aaac990939c16 (diff) | |
gf -server: small logging improvements
Diffstat (limited to 'src')
| -rw-r--r-- | src/compiler/GFServer.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/compiler/GFServer.hs b/src/compiler/GFServer.hs index c48ed3f4a..3ff6bb6ce 100644 --- a/src/compiler/GFServer.hs +++ b/src/compiler/GFServer.hs @@ -64,10 +64,10 @@ server port optroot execute1 state0 = where -- | HTTP server http_server execute1 state0 state cache root = - do putStrLn gf_version - putStrLn $ "Document root = "++root - putStrLn $ "Starting HTTP server, open http://localhost:" - ++show port++"/ in your web browser." + do logPutStrLn gf_version + logPutStrLn $ "Document root = "++root + logPutStrLn $ "Starting HTTP server, open http://localhost:" + ++show port++"/ in your web browser." initServer port (modifyMVar state . handle root state0 cache execute1) gf_version = "This is GF version "++showVersion version++".\n"++buildInfo @@ -225,7 +225,9 @@ handle root state0 cache execute1 flag (n,"") = n flag (n,v) = n++"="++v cmd = unwords ("gf":args) - out <- liftIO $ readProcessWithExitCode "gf" args "" + logPutStrLn cmd + out@(ecode,_,_) <- liftIO $ readProcessWithExitCode "gf" args "" + logPutStrLn $ show ecode cwd <- liftIO $ getCurrentDirectory return $ json200 (jsonresult cwd ('/':dir++"/") cmd out files) |
