@@ -229,12 +229,6 @@ detailedMiddleware' cb ansiColor ansiMethod ansiStatusCode app req sendResponse
229 | otherwise = []
229 | otherwise = []
230 in if null par then [""] else ansiColor White " Params: " <> par <> ["\n"]
230 in if null par then [""] else ansiColor White " Params: " <> par <> ["\n"]
232− -- log the request immediately.
233− liftIO $ cb $ mconcat $ map toLogStr $
234− ansiMethod (requestMethod req) ++ [" ", rawPathInfo req, "\n"] ++
236− ansiColor White " Accept: " ++ [accept, "\n"]
238 t0 <- getCurrentTime
232 t0 <- getCurrentTime
239 app req' $ \rsp -> do
233 app req' $ \rsp -> do
240 let isRaw =
234 let isRaw =
@@ -246,10 +240,14 @@ detailedMiddleware' cb ansiColor ansiMethod ansiStatusCode app req sendResponse
246 t1 <- getCurrentTime
240 t1 <- getCurrentTime
248 -- log the status of the response
242 -- log the status of the response
249− unless isRaw $ cb $ mconcat $ map toLogStr $
243+ cb $ mconcat $ map toLogStr $
244+ ansiMethod (requestMethod req) ++ [" ", rawPathInfo req, "\n"] ++
246+ ansiColor White " Accept: " ++ [accept, "\n"] ++
247+ if isRaw then [] else
250− ansiColor White " Status: " ++
248+ ansiColor White " Status: " ++
251− ansiStatusCode stCode (stCode <> " " <> stMsg) ++
249+ ansiStatusCode stCode (stCode <> " " <> stMsg) ++
252− [" ", pack $ show $ diffUTCTime t1 t0, "\n"]
250+ [" ", pack $ show $ diffUTCTime t1 t0, "\n"]
254 sendResponse rsp
252 sendResponse rsp