summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredoDiNapoli <>2021-04-07 12:54:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2021-04-07 12:54:00 (GMT)
commite37ec5e2429bd07af2bac558a14867ee7c628dcd (patch)
treedfd6847afcdcc9927a9c906c7c02ee89f1c1b4f7
parentc782c14e7e5b3482eb64a08f3833cc121dc177d0 (diff)
version 0.1.2.1HEAD0.1.2.1master
-rwxr-xr-x[-rw-r--r--]README.md0
-rw-r--r--katip-syslog.cabal4
-rw-r--r--src/Katip/Scribes/Syslog.hs10
3 files changed, 12 insertions, 2 deletions
diff --git a/README.md b/README.md
index fd4a648..fd4a648 100644..100755
--- a/README.md
+++ b/README.md
diff --git a/katip-syslog.cabal b/katip-syslog.cabal
index 961a10e..a3e4cef 100644
--- a/katip-syslog.cabal
+++ b/katip-syslog.cabal
@@ -1,5 +1,5 @@
name: katip-syslog
-version: 0.1.2.0
+version: 0.1.2.1
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 @@ library
hs-source-dirs: src
exposed-modules: Katip.Scribes.Syslog
build-depends: base >= 4.7 && < 5
- , katip >= 0.3.1.5 && < 0.8.0.0
+ , katip >= 0.3.1.5 && < 0.9.0.0
, hsyslog >= 4 && < 5
, text < 1.3.0.0
, string-conv < 0.2
diff --git a/src/Katip/Scribes/Syslog.hs b/src/Katip/Scribes/Syslog.hs
index 9d13f31..d6d2400 100644
--- a/src/Katip/Scribes/Syslog.hs
+++ b/src/Katip/Scribes/Syslog.hs
@@ -2,6 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE RankNTypes #-}
module Katip.Scribes.Syslog
( mkSyslogScribe
) where
@@ -28,12 +29,21 @@ mkSyslogScribe ns sev verb = do
}
#if (MIN_VERSION_katip(0,5,0))
let scribe = Scribe (\i@Item{..} -> do
+#if (MIN_VERSION_katip(0,8,0))
+ permit <- permitItem sev i
+ when permit $ do
+#else
when (permitItem sev i) $ do
+#endif
res <- try $ withSyslog cfg $ \syslog -> syslog USER (toSyslogPriority _itemSeverity) (toS $ formatItem verb i)
case res of
Left (e :: SomeException) -> putStrLn (show e)
Right () -> return ())
+#if (MIN_VERSION_katip(0,8,0))
+ (return ()) (permitItem sev)
+#else
(return ())
+#endif
#else
let scribe = Scribe $ \ i@Item{..} -> do
when (permitItem sev i) $ do