Hello community, here is the log from the commit of package ghc-fast-logger for openSUSE:Factory checked in at 2016-04-12 19:37:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-fast-logger (Old) and /work/SRC/openSUSE:Factory/.ghc-fast-logger.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-fast-logger" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-fast-logger/ghc-fast-logger.changes 2015-08-25 08:48:16.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-fast-logger.new/ghc-fast-logger.changes 2016-04-12 19:38:00.000000000 +0200 @@ -1,0 +2,7 @@ +Thu Apr 7 11:33:42 UTC 2016 - mimi...@gmail.com + +- update to 2.4.2 +* Fixing a buf of long log messages +* Unsupporting GHC 7.4 + +------------------------------------------------------------------- Old: ---- fast-logger-2.4.1.tar.gz New: ---- fast-logger-2.4.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-fast-logger.spec ++++++ --- /var/tmp/diff_new_pack.IHQAWc/_old 2016-04-12 19:38:01.000000000 +0200 +++ /var/tmp/diff_new_pack.IHQAWc/_new 2016-04-12 19:38:01.000000000 +0200 @@ -20,7 +20,7 @@ %bcond_with tests Name: ghc-fast-logger -Version: 2.4.1 +Version: 2.4.2 Release: 0 Summary: A fast logging system Group: System/Libraries ++++++ fast-logger-2.4.1.tar.gz -> fast-logger-2.4.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.1/ChangeLog.md new/fast-logger-2.4.2/ChangeLog.md --- old/fast-logger-2.4.1/ChangeLog.md 2015-08-12 14:53:42.000000000 +0200 +++ new/fast-logger-2.4.2/ChangeLog.md 2016-04-05 04:07:56.000000000 +0200 @@ -1,3 +1,22 @@ +## 2.4.2 + +* Fixing a buf of long log messages [#80](https://github.com/kazu-yamamoto/logger/pull/80) +* Log rotation support for Windows [#79](https://github.com/kazu-yamamoto/logger/pull/79) +* Unsupporting GHC 7.4. + +## 2.4.1 + +* Restore compatibility with bytestring < 0.10 +* Mark fast-logger modules as Safe/Trustworth [#68](https://github.com/kazu-yamamoto/logger/pull/68) + +## 2.4.0 + +* Providing pushLogStrLn. [#64](https://github.com/kazu-yamamoto/logger/pull/64) + +## 2.3.1 + +* No changes. + ## 2.3.0 * Move from blaze-builder to `Data.ByteString.Builder` [#55](https://github.com/kazu-yamamoto/logger/pull/55) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.1/System/Log/FastLogger/FileIO.hs new/fast-logger-2.4.2/System/Log/FastLogger/FileIO.hs --- old/fast-logger-2.4.1/System/Log/FastLogger/FileIO.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/fast-logger-2.4.2/System/Log/FastLogger/FileIO.hs 2016-04-05 04:07:56.000000000 +0200 @@ -0,0 +1,61 @@ +{-# LANGUAGE CPP #-} + +module System.Log.FastLogger.FileIO where + +import Foreign.Ptr (Ptr) +import Data.Word (Word8) + +#ifdef mingw32_HOST_OS +import System.Win32.Types (HANDLE) +import System.Win32.File +import Graphics.Win32.Misc (getStdHandle, sTD_OUTPUT_HANDLE, sTD_ERROR_HANDLE) +import Data.Bits ((.|.)) + +type FD = HANDLE + +closeFD :: FD -> IO () +closeFD = closeHandle + +openFileFD :: FilePath -> IO FD +openFileFD f = createFile f + (gENERIC_READ .|. gENERIC_WRITE) + (fILE_SHARE_READ .|. fILE_SHARE_DELETE) + Nothing + oPEN_ALWAYS + fILE_ATTRIBUTE_NORMAL + Nothing + +getStderrFD :: IO FD +getStderrFD = getStdHandle sTD_ERROR_HANDLE + +getStdoutFD :: IO FD +getStdoutFD = getStdHandle sTD_OUTPUT_HANDLE + +writeRawBufferPtr2FD :: FD -> Ptr Word8 -> Int -> IO Int +writeRawBufferPtr2FD h bf len = fromIntegral `fmap` win32_WriteFile h bf (fromIntegral len) Nothing + +#else + +import GHC.IO.Device (close) +import qualified GHC.IO.FD as POSIX (FD(..)) +import GHC.IO.FD (openFile, stderr, stdout, writeRawBufferPtr) +import GHC.IO.IOMode (IOMode(..)) + +type FD = POSIX.FD + +closeFD :: FD -> IO () +closeFD = close + +openFileFD :: FilePath -> IO FD +openFileFD f = fst `fmap` openFile f AppendMode False + +getStderrFD :: IO FD +getStderrFD = return stderr + +getStdoutFD :: IO FD +getStdoutFD = return stdout + +writeRawBufferPtr2FD :: FD -> Ptr Word8 -> Int -> IO Int +writeRawBufferPtr2FD fd bf len = fromIntegral `fmap` writeRawBufferPtr "write" fd bf 0 (fromIntegral len) + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.1/System/Log/FastLogger/IO.hs new/fast-logger-2.4.2/System/Log/FastLogger/IO.hs --- old/fast-logger-2.4.1/System/Log/FastLogger/IO.hs 2015-08-12 14:53:42.000000000 +0200 +++ new/fast-logger-2.4.2/System/Log/FastLogger/IO.hs 2016-04-05 04:07:56.000000000 +0200 @@ -38,6 +38,5 @@ More minSize writer' | size < minSize -> error "toBufIOWith: More: minSize" | otherwise -> loop writer' - Chunk (PS fptr off siz) writer' - | len == 0 -> loop writer' -- flushing - | otherwise -> withForeignPtr fptr $ \ptr -> io (ptr `plusPtr` off) siz + Chunk (PS fptr off siz) writer' -> + withForeignPtr fptr $ \ptr -> io (ptr `plusPtr` off) siz >> loop writer' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.1/System/Log/FastLogger/Logger.hs new/fast-logger-2.4.2/System/Log/FastLogger/Logger.hs --- old/fast-logger-2.4.1/System/Log/FastLogger/Logger.hs 2015-08-12 14:53:42.000000000 +0200 +++ new/fast-logger-2.4.2/System/Log/FastLogger/Logger.hs 2016-04-05 04:07:56.000000000 +0200 @@ -11,7 +11,7 @@ import Control.Concurrent (MVar, newMVar, withMVar) import Control.Monad (when) import Foreign.Ptr (plusPtr) -import GHC.IO.FD (FD, writeRawBufferPtr) +import System.Log.FastLogger.FileIO import System.Log.FastLogger.IO import System.Log.FastLogger.LogStr import System.Log.FastLogger.IORef @@ -77,6 +77,6 @@ write fd buf len' = loop buf (fromIntegral len') where loop bf !len = do - written <- writeRawBufferPtr "write" fd bf 0 (fromIntegral len) + written <- writeRawBufferPtr2FD fd bf len when (written < len) $ loop (bf `plusPtr` fromIntegral written) (len - written) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.1/System/Log/FastLogger.hs new/fast-logger-2.4.2/System/Log/FastLogger.hs --- old/fast-logger-2.4.1/System/Log/FastLogger.hs 2015-08-12 14:53:42.000000000 +0200 +++ new/fast-logger-2.4.2/System/Log/FastLogger.hs 2016-04-05 04:07:56.000000000 +0200 @@ -1,6 +1,6 @@ -- | This module provides a fast logging system which -- scales on multicore environments (i.e. +RTS -N\<x\>). -{-# LANGUAGE BangPatterns, CPP #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-} module System.Log.FastLogger ( @@ -38,23 +38,15 @@ import Control.Monad (when, replicateM) import Data.Array (Array, listArray, (!), bounds) import Data.Maybe (isJust) -import GHC.IO.Device (close) -import GHC.IO.FD (FD(..), openFile, stderr, stdout) -import GHC.IO.IOMode (IOMode(..)) import System.Log.FastLogger.File import System.Log.FastLogger.IO +import System.Log.FastLogger.FileIO import System.Log.FastLogger.IORef import System.Log.FastLogger.LogStr import System.Log.FastLogger.Logger ---------------------------------------------------------------- --- | Opening a log file. -logOpen :: FilePath -> IO FD -logOpen file = fst <$> openFile file AppendMode False - ----------------------------------------------------------------- - -- | A set of loggers. -- The number of loggers is the capabilities of GHC RTS. -- You can specify it with \"+RTS -N\<x\>\". @@ -63,15 +55,15 @@ -- | Creating a new 'LoggerSet' using a file. newFileLoggerSet :: BufSize -> FilePath -> IO LoggerSet -newFileLoggerSet size file = logOpen file >>= newFDLoggerSet size (Just file) +newFileLoggerSet size file = openFileFD file >>= newFDLoggerSet size (Just file) -- | Creating a new 'LoggerSet' using stdout. newStdoutLoggerSet :: BufSize -> IO LoggerSet -newStdoutLoggerSet size = newFDLoggerSet size Nothing stdout +newStdoutLoggerSet size = getStdoutFD >>= newFDLoggerSet size Nothing -- | Creating a new 'LoggerSet' using stderr. newStderrLoggerSet :: BufSize -> IO LoggerSet -newStderrLoggerSet size = newFDLoggerSet size Nothing stderr +newStderrLoggerSet size = getStderrFD >>= newFDLoggerSet size Nothing {-# DEPRECATED newLoggerSet "Use newFileLoggerSet etc instead" #-} -- | Creating a new 'LoggerSet'. @@ -139,9 +131,9 @@ renewLoggerSet :: LoggerSet -> IO () renewLoggerSet (LoggerSet Nothing _ _ _) = return () renewLoggerSet (LoggerSet (Just file) fref _ _) = do - newfd <- logOpen file + newfd <- openFileFD file oldfd <- atomicModifyIORef' fref (\fd -> (newfd, fd)) - close oldfd + closeFD oldfd -- | Flushing the buffers, closing the internal file information -- and freeing the buffers. @@ -152,7 +144,7 @@ let nums = [l .. u] mapM_ (flushIt fd) nums mapM_ freeIt nums - when (isJust mfile) $ close fd + when (isJust mfile) $ closeFD fd where flushIt fd i = flushLog fd (arr ! i) freeIt i = do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fast-logger-2.4.1/fast-logger.cabal new/fast-logger-2.4.2/fast-logger.cabal --- old/fast-logger-2.4.1/fast-logger.cabal 2015-08-12 14:53:42.000000000 +0200 +++ new/fast-logger-2.4.2/fast-logger.cabal 2016-04-05 04:07:56.000000000 +0200 @@ -1,5 +1,5 @@ Name: fast-logger -Version: 2.4.1 +Version: 2.4.2 Author: Kazu Yamamoto <k...@iij.ad.jp> Maintainer: Kazu Yamamoto <k...@iij.ad.jp> License: BSD3 @@ -16,10 +16,11 @@ Exposed-Modules: System.Log.FastLogger System.Log.FastLogger.File Other-Modules: System.Log.FastLogger.IO + System.Log.FastLogger.FileIO System.Log.FastLogger.IORef System.Log.FastLogger.LogStr System.Log.FastLogger.Logger - Build-Depends: base >= 4.4 && < 5 + Build-Depends: base >= 4.5 && < 5 , array , auto-update >= 0.1.2 , bytestring @@ -27,6 +28,9 @@ , directory , filepath , text + if os(windows) + Build-Depends: + Win32 Test-Suite spec Main-Is: Spec.hs