mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 16:42:51 -06:00
gf -server: small logging improvements
This commit is contained in:
@@ -64,9 +64,9 @@ server port optroot execute1 state0 =
|
|||||||
where
|
where
|
||||||
-- | HTTP server
|
-- | HTTP server
|
||||||
http_server execute1 state0 state cache root =
|
http_server execute1 state0 state cache root =
|
||||||
do putStrLn gf_version
|
do logPutStrLn gf_version
|
||||||
putStrLn $ "Document root = "++root
|
logPutStrLn $ "Document root = "++root
|
||||||
putStrLn $ "Starting HTTP server, open http://localhost:"
|
logPutStrLn $ "Starting HTTP server, open http://localhost:"
|
||||||
++show port++"/ in your web browser."
|
++show port++"/ in your web browser."
|
||||||
initServer port (modifyMVar state . handle root state0 cache execute1)
|
initServer port (modifyMVar state . handle root state0 cache execute1)
|
||||||
|
|
||||||
@@ -225,7 +225,9 @@ handle root state0 cache execute1
|
|||||||
flag (n,"") = n
|
flag (n,"") = n
|
||||||
flag (n,v) = n++"="++v
|
flag (n,v) = n++"="++v
|
||||||
cmd = unwords ("gf":args)
|
cmd = unwords ("gf":args)
|
||||||
out <- liftIO $ readProcessWithExitCode "gf" args ""
|
logPutStrLn cmd
|
||||||
|
out@(ecode,_,_) <- liftIO $ readProcessWithExitCode "gf" args ""
|
||||||
|
logPutStrLn $ show ecode
|
||||||
cwd <- liftIO $ getCurrentDirectory
|
cwd <- liftIO $ getCurrentDirectory
|
||||||
return $ json200 (jsonresult cwd ('/':dir++"/") cmd out files)
|
return $ json200 (jsonresult cwd ('/':dir++"/") cmd out files)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user