packages feed

fast-logger 2.1.1 → 2.1.2

raw patch · 3 files changed

+4/−3 lines, 3 files

Files

System/Log/FastLogger.hs view
@@ -53,13 +53,14 @@ -- | Creating a new 'LoggerSet'. --   If 'Nothing' is specified to the second argument, --   stdout is used.+--   Please note that the minimum 'BufSize' is 1. newLoggerSet :: BufSize -> Maybe FilePath -> IO LoggerSet newLoggerSet size mfile = do     fd <- case mfile of         Nothing   -> return stdout         Just file -> logOpen file     n <- getNumCapabilities-    loggers <- replicateM n $ newLogger size+    loggers <- replicateM n $ newLogger (max 1 size)     let arr = listArray (0,n-1) loggers     fref <- newIORef fd     return $ LoggerSet mfile fref arr
System/Log/FastLogger/Logger.hs view
@@ -34,7 +34,7 @@ pushLog fd logger@(Logger mbuf size ref) nlogmsg@(LogStr nlen nbuilder)   | nlen > size = do       flushLog fd logger-      withMVar mbuf $ \buf -> toBufIOWith buf nlen (write fd) nbuilder+      withMVar mbuf $ \buf -> toBufIOWith buf size (write fd) nbuilder   | otherwise = do     mmsg <- atomicModifyIORef' ref checkBuf     case mmsg of
fast-logger.cabal view
@@ -1,5 +1,5 @@ Name:                   fast-logger-Version:                2.1.1+Version:                2.1.2 Author:                 Kazu Yamamoto <kazu@iij.ad.jp> Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp> License:                BSD3