log-base 0.7.2.0 → 0.7.3.0
raw patch · 4 files changed
+21/−11 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +8/−4
- log-base.cabal +2/−2
- src/Log/Backend/StandardOutput.hs +6/−2
- src/Log/Backend/StandardOutput/Bulk.hs +5/−3
CHANGELOG.md view
@@ -1,13 +1,17 @@+# log-base-0.7.3.0 (2017-10-10)+* `BasicStdOutLogger` now flushes stdout on each write. `BulkStdOutLogger`+ now flushes stdout on each bulk write ([#38](https://github.com/scrive/log/issues/38)).+ # log-base-0.7.2.0 (2017-08-10)-* Add 'MFunctor LogT' instance+* Add 'MFunctor LogT' instance ([#35](https://github.com/scrive/log/issues/35) ). # log-base-0.7.1.1 (2017-06-19) * mkBulkLogger now uses a bounded queue to interact with the logger thread. # log-base-0.7.1 (2017-03-16)-* Added a few MTL class instances (#28).+* Added a few MTL class instances ([#28](https://github.com/scrive/log/issues/28)). # log-base-0.7 (2016-11-25) * Initial release (split from the log package).-* Improved documentation (#22).-* Implement 'toEncoding' directly in 'ToJSON' instances (#21).+* Improved documentation ([#22](https://github.com/scrive/log/issues/22)).+* Implement 'toEncoding' directly in 'ToJSON' instances ([#21](https://github.com/scrive/log/issues/21)).
log-base.cabal view
@@ -1,5 +1,5 @@ name: log-base-version: 0.7.2.0+version: 0.7.3.0 synopsis: Structured logging solution (base package) description: A library that provides a way to record structured log@@ -37,7 +37,7 @@ Log.Internal.Logger, Log.Logger, Log.Monad- build-depends: base <5,+ build-depends: base >= 4.8 && <5, aeson >=0.11.0.0, aeson-pretty >=0.8.2, bytestring,
src/Log/Backend/StandardOutput.hs view
@@ -22,10 +22,14 @@ {-# DEPRECATED simpleStdoutLogger "Use 'withSimpleStdOutLogger'" #-} --- | Simple, synchronous logger that prints messages to standard output.+-- | Simple, synchronous logger that prints messages to standard+-- output. Flushes 'stdout' on each call to 'loggerWriteMessage'. Use+-- 'Log.Backend.StandardOutput.Bulk.withBulkStdOutLogger' if you want+-- buffering. simpleStdoutLogger :: Logger simpleStdoutLogger = Logger {- loggerWriteMessage = T.putStrLn . showLogMessage Nothing+ loggerWriteMessage = \msg -> (T.putStrLn . showLogMessage Nothing $ msg)+ >> hFlush stdout , loggerWaitForWrite = hFlush stdout , loggerShutdown = return () }
src/Log/Backend/StandardOutput/Bulk.hs view
@@ -6,6 +6,7 @@ import Prelude import qualified Data.Text.IO as T+import System.IO (hFlush, stdout) import Log.Data import Log.Logger@@ -13,7 +14,7 @@ -- | Create a 'bulkStdoutLogger' for the duration of the given action, -- and shut it down afterwards, making sure that all buffered messages--- are actually written to stdout.+-- are actually written to stdout. Flushes 'stdout' on each bulk write. withBulkStdOutLogger :: (Logger -> IO r) -> IO r withBulkStdOutLogger act = do logger <- bulkStdoutLogger@@ -28,5 +29,6 @@ -- (see the note attached to 'mkBulkLogger'). bulkStdoutLogger :: IO Logger bulkStdoutLogger = mkBulkLogger "stdout-bulk"- (mapM_ $ T.putStrLn . showLogMessage Nothing)- (return ())+ (\msgs -> mapM_ (T.putStrLn . showLogMessage Nothing) msgs+ >> hFlush stdout)+ (hFlush stdout)