hsyslog-udp 0.2.0 → 0.2.1
raw patch · 2 files changed
+7/−6 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ System.Posix.Syslog.UDP: [onException] :: SyslogConfig -> SomeException -> IO ()
- System.Posix.Syslog.UDP: SyslogConfig :: !AppName -> !HostName -> !ProcessID -> !SeverityMask -> !AddrInfo -> Protocol -> SyslogConfig
+ System.Posix.Syslog.UDP: SyslogConfig :: !AppName -> !HostName -> !ProcessID -> !SeverityMask -> !AddrInfo -> Protocol -> (SomeException -> IO ()) -> SyslogConfig
Files
- hsyslog-udp.cabal +3/−3
- src/System/Posix/Syslog/UDP.hs +4/−3
hsyslog-udp.cabal view
@@ -1,5 +1,5 @@ name: hsyslog-udp-version: 0.2.0+version: 0.2.1 synopsis: Log to syslog over a network via UDP description: Supports <https://tools.ietf.org/html/rfc5424 RFC 5424>, <https://tools.ietf.org/html/rfc3164 RFC 3164>, or any@@ -8,8 +8,8 @@ bug-reports: https://github.com/ThoughtLeadr/hsyslog-udp/issues license: BSD3 license-file: LICENSE-author: Jon Childress-maintainer: jon@childr.es+author: Jon Childress <jon@childr.es>+maintainer: Kostiantyn Rybnikov <konstantine@thoughtleadr.com> category: System build-type: Simple extra-source-files: README.md
src/System/Posix/Syslog/UDP.hs view
@@ -149,6 +149,7 @@ initSyslog config = S.withSocketsDo $ do socket <- S.socket (S.addrFamily $ address config) S.Datagram udpProtoNum let send = flip (SB.sendTo socket) (S.addrAddress $ address config)+ safely f = catch (void f) (onException config) return $ \facility severity message -> case maskedPriVal (severityMask config) facility severity of@@ -186,6 +187,8 @@ , protocol :: Protocol -- ^ protocol for formatting the message, such as 'rfc5424Protocol' or -- 'rfc3164Protocol'+ , onException :: SomeException -> IO ()+ -- ^ custom exception handler } -- | A convenient default config for connecting to 'localhost'. Provided for@@ -201,6 +204,7 @@ severityMask = [minBound..maxBound] address = localhost protocol = rfc3164Protocol+ onException = const $ return () -- | The default IPv4 address/port for syslog on a local machine. Provided for -- development/testing purposes.@@ -409,9 +413,6 @@ where mkHost (HostName x) = notEmpty x mkTag (AppName name) (ProcessID procId) = name <> "[" <> procId <> "]:"--safely :: IO a -> IO ()-safely f = catch (void f) (const $ return () :: SomeException -> IO ()) sp :: ByteString -> ByteString -> ByteString sp b1 b2 = b1 <> " " <> b2