Skip to content

Commit

Permalink
version 0.1.3.2: flush stdout in logs (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
maksbotan authored Nov 19, 2020
1 parent 510978d commit 7940a6f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.3.2] - 2020-11-19
### Fixed
- Flush `stdout` after writing logs.

## [0.1.3.1] - 2020-11-19
### Changed
- Rewrite logging middleware: do not force reading the whole request before passing it to the
Expand Down
3 changes: 2 additions & 1 deletion src/Web/Template/Log.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Network.HTTP.Types.Status (Status (..))
import Network.Wai (Middleware, rawPathInfo, requestMethod, responseStatus)
import Network.Wai.Internal (Response (..))
import System.BCD.Log (Level (..))
import System.IO (stdout)
import System.IO (hFlush, stdout)

bcdlog :: Middleware
bcdlog = logMiddleware False
Expand Down Expand Up @@ -64,6 +64,7 @@ logMiddleware log400 app request respond = do
)

hPutBuilder stdout (fromEncoding logLine <> "\n")
hFlush stdout

return rcv
where
Expand Down
2 changes: 1 addition & 1 deletion web-template.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: web-template
version: 0.1.3.1
version: 0.1.3.2
synopsis: Web template
description:
Web template includes:
Expand Down

0 comments on commit 7940a6f

Please sign in to comment.