hslogger 1.3.1.1 → 1.3.1.2
raw patch · 7 files changed
+39/−54 lines, 7 filesdep ~bytestringdep ~containersdep ~deepseqsetup-changedPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: bytestring, containers, deepseq, network, old-locale, time, unix
API changes (from Hackage documentation)
Files
- CHANGELOG.md +16/−4
- Setup.hs +0/−5
- hslogger.cabal +14/−12
- src/System/Log.hs +0/−9
- src/System/Log/Formatter.hs +0/−4
- src/System/Log/Handler/Log4jXML.hs +0/−4
- src/System/Log/Logger.hs +9/−16
CHANGELOG.md view
@@ -1,16 +1,28 @@-See also https://pvp.haskell.org/faq+#### 1.3.1.2 -#### 1.3.1.1 *(patch)*+_2025-03-11, Andreas Abel_ +- Thoroughly drop support for GHC 7+- Allow newer `containers`+- Tested with GHC 8.0 - 9.12.1++#### 1.3.1.1++_2024-04-15, Andreas Abel_+ - Drop support for GHC 7 - Tested with GHC 8.0 - 9.10 -### 1.3.1.0 *(minor)*+### 1.3.1.0 +_2019-10-07, Herbert Valerio Riedel_+ - Evaluate message before taking lock in simple handler ([#49](https://github.com/haskell-hvr/hslogger/pull/49)) - Define `Typeable`, `Data`, `Generic` and `NFData` instances for `System.Log.Priority` ([#43](https://github.com/haskell-hvr/hslogger/pull/43)) -## 1.3.0.0 *(major)*+## 1.3.0.0++_2019-04-15, Herbert Valerio Riedel_ - **[semantic change]** Messages are encoded as UTF-8 (previously the encoding was locale dependent) for the Syslog and Growl backends - Add support for `network-3.0`; remove redundant dependency on `directory` and `process`
− Setup.hs
@@ -1,5 +0,0 @@-#!/usr/bin/env runhaskell--import Distribution.Simple--main = defaultMain
hslogger.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12 build-type: Simple name: hslogger-version: 1.3.1.1+version: 1.3.1.2 maintainer: https://github.com/haskell-hvr/hslogger author: John Goerzen@@ -35,9 +35,10 @@ testsrc/runtests.hs tested-with:- GHC == 9.10.0- GHC == 9.8.2- GHC == 9.6.4+ GHC == 9.12.1+ GHC == 9.10.1+ GHC == 9.8.4+ GHC == 9.6.6 GHC == 9.4.8 GHC == 9.2.8 GHC == 9.0.2@@ -75,21 +76,22 @@ other-extensions: CPP ExistentialQuantification DeriveDataTypeable build-depends:- base >= 4.9 && < 5- , bytestring >= 0.9 && < 0.13- , containers >= 0.4 && < 0.8- , deepseq >= 1.1 && < 1.6- , time >= 1.2 && < 1.15- , old-locale >= 1.0 && < 1.1+ -- Lower bounds are chosen from LTS 7.24 (GHC 8.0.1)+ base >= 4.9 && < 5+ , bytestring >= 0.10.8.1 && < 0.13+ , containers >= 0.5.7.1 && < 1+ , deepseq >= 1.4.2.0 && < 1.6+ , time >= 1.6.0.1 && < 1.15+ , old-locale >= 1.0.0.7 && < 1.1 if flag(network--GT-3_0_0) build-depends: network-bsd >= 2.8.1 && <2.9, network >= 3.0 && <3.3 else- build-depends: network >= 2.6 && <2.9+ build-depends: network >= 2.6.3.1 && <2.9 if !os(windows)- Build-Depends: unix >= 2.4.2 && < 2.9+ Build-Depends: unix >= 2.7.2.0 && < 2.9 test-suite runtests type: exitcode-stdio-1.0
src/System/Log.hs view
@@ -1,9 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-}--#if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE DeriveGeneric #-}-#endif {- | Module : System.Log@@ -34,9 +31,7 @@ import Control.DeepSeq (NFData(rnf)) import Data.Data (Data, Typeable)-#if __GLASGOW_HASKELL__ >= 702 import GHC.Generics (Generic)-#endif {- | Priorities are used to define how important a log message is. Users can filter log messages based on priorities.@@ -55,11 +50,7 @@ | CRITICAL -- ^ Severe situations | ALERT -- ^ Take immediate action | EMERGENCY -- ^ System is unusable-#if __GLASGOW_HASKELL__ >= 702 deriving (Eq, Ord, Enum, Bounded, Show, Read, Data, Typeable, Generic)-#else- deriving (Eq, Ord, Enum, Bounded, Show, Read, Data, Typeable)-#endif -- | @since 1.3.1.0 instance NFData Priority where rnf = (`seq` ())
src/System/Log/Formatter.hs view
@@ -30,11 +30,7 @@ import System.Posix.Process (getProcessID) #endif -#if MIN_VERSION_time(1,5,0) import Data.Time.Format (defaultTimeLocale)-#else-import System.Locale (defaultTimeLocale)-#endif import Data.Time (getZonedTime,getCurrentTime,formatTime) import System.Log
src/System/Log/Handler/Log4jXML.hs view
@@ -107,11 +107,7 @@ import Control.Concurrent (myThreadId) -- myThreadId is GHC only! import Data.List (isPrefixOf) import System.IO-#if MIN_VERSION_time(1,5,0) import Data.Time.Format (defaultTimeLocale)-#else-import System.Locale (defaultTimeLocale)-#endif import Data.Time import System.Log import System.Log.Handler
src/System/Log/Logger.hs view
@@ -471,9 +471,9 @@ > (setLevel DEBUG . setHandlers [s]) -} -updateGlobalLogger :: String -- ^ Logger name- -> (Logger -> Logger) -- ^ Function to call- -> IO ()+updateGlobalLogger :: String -- ^ Logger name+ -> (Logger -> Logger) -- ^ Function to call+ -> IO () updateGlobalLogger ln func = do l <- getLogger ln saveGlobalLogger (func l)@@ -482,28 +482,21 @@ removeAllHandlers :: IO () removeAllHandlers = modifyMVar_ logTree $ \lt -> do- let allHandlers = mapFoldr (\l r -> concat [r, handlers l]) [] lt+ let allHandlers = Map.foldr (\l r -> concat [r, handlers l]) [] lt mapM_ (\(HandlerT h) -> close h) allHandlers return $ Map.map (\l -> l {handlers = []}) lt -mapFoldr :: (a -> b -> b) -> b -> Map.Map k a -> b-#if MIN_VERSION_containers(0,4,2)-mapFoldr = Map.foldr-#else-mapFoldr f z = foldr f z . Map.elems-#endif- {- | Traps exceptions that may occur, logging them, then passing them on. Takes a logger name, priority, leading description text (you can set it to @\"\"@ if you don't want any), and action to run. -} -traplogging :: String -- Logger name- -> Priority -- Logging priority- -> String -- Descriptive text to prepend to logged messages- -> IO a -- Action to run- -> IO a -- Return value+traplogging :: String -- ^ Logger name+ -> Priority -- ^ Logging priority+ -> String -- ^ Descriptive text to prepend to logged messages+ -> IO a -- ^ Action to run+ -> IO a -- ^ Return value traplogging logger priority' desc action = let realdesc = case desc of "" -> ""