@@ -95,20 +95,19 @@ mkRequestLogger RequestLoggerSettings{..} = do
95 Handle h -> (BS.hPutStr h . logToByteString, when autoFlush (hFlush h))
95 Handle h -> (BS.hPutStr h . logToByteString, when autoFlush (hFlush h))
96 Logger l -> (pushLogStr l, when autoFlush (flushLogStr l))
96 Logger l -> (pushLogStr l, when autoFlush (flushLogStr l))
97 Callback c -> (c, return ())
97 Callback c -> (c, return ())
98+ callbackAndFlush str = callback str >> flusher
98 case outputFormat of
99 case outputFormat of
99 Apache ipsrc -> do
100 Apache ipsrc -> do
100 getdate <- getDateGetter flusher
101 getdate <- getDateGetter flusher
101 apache <- initLogger ipsrc (LogCallback callback flusher) getdate
102 apache <- initLogger ipsrc (LogCallback callback flusher) getdate
102 return $ apacheMiddleware apache
103 return $ apacheMiddleware apache
103− Detailed useColors -> detailedMiddleware
104+ Detailed useColors -> detailedMiddleware callbackAndFlush useColors
104− (\str -> callback str >> flusher)
106 CustomOutputFormat formatter -> do
105 CustomOutputFormat formatter -> do
107 getDate <- getDateGetter flusher
106 getDate <- getDateGetter flusher
108− return $ customMiddleware callback getDate formatter
107+ return $ customMiddleware callbackAndFlush getDate formatter
109 CustomOutputFormatWithDetails formatter -> do
108 CustomOutputFormatWithDetails formatter -> do
110 getdate <- getDateGetter flusher
109 getdate <- getDateGetter flusher
111− return $ customMiddlewareWithDetails callback getdate formatter
110+ return $ customMiddlewareWithDetails callbackAndFlush getdate formatter
113apacheMiddleware :: ApacheLoggerActions -> Middleware
112apacheMiddleware :: ApacheLoggerActions -> Middleware
114apacheMiddleware ala app req sendResponse = app req $ \res -> do
113apacheMiddleware ala app req sendResponse = app req $ \res -> do