@@ -29,6 +29,7 @@ import System.Log.FastLogger
2929import Network.HTTP.Types as H
3030import Data.Maybe (fromMaybe)
3131import Data.Monoid (mconcat)
32+import Data.Time (getCurrentTime, diffUTCTime)
3233
3334import Network.Wai.Parse (sinkRequestBody, lbsBackEnd, fileName, Param, File, getRequestBodyType)
3435import qualified Data.ByteString.Lazy as LBS
@@ -152,13 +153,11 @@ rotateColors (c:cs) = (cs ++ [c], c)
152153--
153154-- Example ouput:
154155--
155−-- > GET search
156−-- > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
156+-- > GET search :: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
157157-- >
158158-- > Status: 200 OK. search
159159-- >
160−-- > GET static/css/normalize.css
161−-- > Accept: text/css,*/*;q=0.1
160+-- > GET static/css/normalize.css :: text/css,*/*;q=0.1
162161-- > GET [("LXwioiBG","")]
163162-- >
164163-- > Status: 304 Not Modified. static/css/normalize.css
@@ -235,11 +234,13 @@ detailedMiddleware' cb getAddColor app req sendResponse = do
235234 , "\n"
236235 ]
237236
237+ t0 <- getCurrentTime
238238 app req' $ \rsp -> do
239239 let isRaw =
240240 case rsp of
241241 ResponseRaw{} -> True
242242 _ -> False
243+ t1 <- getCurrentTime
243244
244245 -- log the status of the response
245246 -- this is color coordinated with the request logging
@@ -249,6 +250,8 @@ detailedMiddleware' cb getAddColor app req sendResponse = do
249250 [ " "
250251 , msgBS rsp
251252 , ". "
253+ , pack $ show $ diffUTCTime t1 t0
254+ , ". "
252255 , rawPathInfo req -- if you need help matching the 2 logging statements
253256 , "\n"
254257 ]