Skip to content

Commit 7940a6f

Browse files
authored
version 0.1.3.2: flush stdout in logs (#19)
1 parent 510978d commit 7940a6f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [0.1.3.2] - 2020-11-19
10+
### Fixed
11+
- Flush `stdout` after writing logs.
12+
913
## [0.1.3.1] - 2020-11-19
1014
### Changed
1115
- Rewrite logging middleware: do not force reading the whole request before passing it to the

src/Web/Template/Log.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Network.HTTP.Types.Status (Status (..))
1919
import Network.Wai (Middleware, rawPathInfo, requestMethod, responseStatus)
2020
import Network.Wai.Internal (Response (..))
2121
import System.BCD.Log (Level (..))
22-
import System.IO (stdout)
22+
import System.IO (hFlush, stdout)
2323

2424
bcdlog :: Middleware
2525
bcdlog = logMiddleware False
@@ -64,6 +64,7 @@ logMiddleware log400 app request respond = do
6464
)
6565

6666
hPutBuilder stdout (fromEncoding logLine <> "\n")
67+
hFlush stdout
6768

6869
return rcv
6970
where

web-template.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: web-template
2-
version: 0.1.3.1
2+
version: 0.1.3.2
33
synopsis: Web template
44
description:
55
Web template includes:

0 commit comments

Comments
 (0)