@@ -130,11 +130,10 @@ logStdoutDev = unsafePerformIO $ mkRequestLogger def
130130-- no black or white which are expected to be existing terminal colors.
131131colors0 :: [Color]
132132colors0 = [
133− Red
134− , Green
135− , Yellow
136− , Blue
137− , Magenta
133+ Green
134+ , Yellow
135+ , Blue
136+ , Magenta
138137 , Cyan
139138 ]
140139
@@ -170,13 +169,11 @@ rotateColors (c:cs) = (cs ++ [c], c)
170169detailedMiddleware :: Callback -> Bool -> IO Middleware
171170detailedMiddleware cb useColors = do
172171 getAddColor <-
173− if useColors
174− then do
172+ if not useColors then return (return return) else do
175173 icolors <- newIORef colors0
176174 return $ do
177175 color <- liftIO $ atomicModifyIORef icolors rotateColors
178176 return $ ansiColor color
179− else return (return return)
180177 return $ detailedMiddleware' cb getAddColor
181178
182179ansiColor :: Color -> BS.ByteString -> [BS.ByteString]
@@ -279,7 +276,7 @@ detailedMiddleware' cb getAddColor app req = do
279276
280277statusBS :: Response -> [BS.ByteString]
281278statusBS rsp =
282− if status > 400 then ansiColor Red bs else [bs]
279+ if status >= 400 then ansiColor Red bs else [bs]
283280 where
284281 bs = pack $ show status
285282 status = statusCode $ responseStatus rsp