katip-syslog 0.1.1.0 → 0.1.2.0
raw patch · 2 files changed
+12/−3 lines, 2 filesdep ~katipPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: katip
API changes (from Hackage documentation)
Files
- katip-syslog.cabal +2/−2
- src/Katip/Scribes/Syslog.hs +10/−1
katip-syslog.cabal view
@@ -1,5 +1,5 @@ name: katip-syslog-version: 0.1.1.0+version: 0.1.2.0 synopsis: Syslog Katip Scribe description: A simple Katip Scribe which logs to syslog homepage: https://github.com/iconnect/katip-syslog#readme@@ -23,7 +23,7 @@ hs-source-dirs: src exposed-modules: Katip.Scribes.Syslog build-depends: base >= 4.7 && < 5- , katip < 0.8.0.0+ , katip >= 0.3.1.5 && < 0.8.0.0 , hsyslog >= 4 && < 5 , text < 1.3.0.0 , string-conv < 0.2
src/Katip/Scribes/Syslog.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-}@@ -25,6 +26,7 @@ , options = [PID, CONS, ODELAY, NDELAY] , priorityMask = NoMask -- Katip does the masking for us. }+#if (MIN_VERSION_katip(0,5,0)) let scribe = Scribe (\i@Item{..} -> do when (permitItem sev i) $ do res <- try $ withSyslog cfg $ \syslog -> syslog USER (toSyslogPriority _itemSeverity) (toS $ formatItem verb i)@@ -32,7 +34,14 @@ Left (e :: SomeException) -> putStrLn (show e) Right () -> return ()) (return ())-+#else+ let scribe = Scribe $ \ i@Item{..} -> do+ when (permitItem sev i) $ do+ res <- try $ withSyslog cfg $ \syslog -> syslog USER (toSyslogPriority _itemSeverity) (toS $ formatItem verb i)+ case res of+ Left (e :: SomeException) -> putStrLn (show e)+ Right () -> return ()+#endif return (scribe, return ()) --------------------------------------------------------------------------------