libsystemd-journal 1.1.0 → 1.2.0
raw patch · 3 files changed
+19/−3 lines, 3 filesdep ~base
Dependency ranges changed: base
Files
- Changelog.md +6/−0
- libsystemd-journal.cabal +2/−2
- src/Systemd/Journal.hsc +11/−1
Changelog.md view
@@ -1,3 +1,9 @@+# 1.2.0++* Builds with base 4.7+* `openJournal` now takes an optional threshold parameter. Thanks Shea Levy+ (@shlevy).+ # 1.1.0 * It is now possible to read the journal.
libsystemd-journal.cabal view
@@ -1,5 +1,5 @@ name: libsystemd-journal-version: 1.1.0+version: 1.2.0 synopsis: Haskell bindings to libsystemd-journal homepage: http://github.com/ocharles/libsystemd-journal license: BSD3@@ -16,7 +16,7 @@ library exposed-modules: Systemd.Journal- build-depends: base >=4.6 && <4.7, bytestring >= 0.9.1, pipes >= 4.0, pipes-safe >= 2.0, text >= 0.1 && < 1.2, transformers >= 0.3, unix-bytestring >= 0.3.2 && < 0.4, vector >= 0.4 && < 0.11, uuid, unordered-containers >= 0.1 && < 0.3, hashable >= 1.1.2.5, hsyslog, uniplate >= 1.6+ build-depends: base >=4.6 && <4.8, bytestring >= 0.9.1, pipes >= 4.0, pipes-safe >= 2.0, text >= 0.1 && < 1.2, transformers >= 0.3, unix-bytestring >= 0.3.2 && < 0.4, vector >= 0.4 && < 0.11, uuid, unordered-containers >= 0.1 && < 0.3, hashable >= 1.1.2.5, hsyslog, uniplate >= 1.6 hs-source-dirs: src default-language: Haskell2010 extra-libraries: systemd-journal
src/Systemd/Journal.hsc view
@@ -230,6 +230,9 @@ foreign import ccall "sd_journal_wait" sdJournalWait :: Ptr JournalEntry -> #{type uint64_t} -> IO #{type int} +foreign import ccall "sd_journal_set_data_threshold"+ sdJournalSetDataThreshold :: Ptr JournalEntry -> #{type size_t} -> IO #{type int}+ foreign import ccall "strerror" c'strerror :: #{type int} -> IO CString @@ -300,8 +303,10 @@ -> Maybe Filter -- ^ An optional filter to apply the journal. Only entries satisfying the -- filter will be emitted.+ -> Maybe Integer+ -- ^ The data field size threshold, or Nothing for no field size limit -> Pipes.Producer' JournalEntry m ()-openJournal flags start journalFilter =+openJournal flags start journalFilter threshold = Pipes.bracket (liftIO openJournalPtr) (liftIO . sdJournalClose) go where@@ -325,6 +330,11 @@ FromCursor cursor -> void $ BS.useAsCString cursor (sdJournalSeekCursor journalPtr)++ _ <- throwIfNeg (("sd_journal_set_data_threshold returned: " ++) . show) .+ sdJournalSetDataThreshold journalPtr $ case threshold of+ Nothing -> fromIntegral (0 :: Integer)+ Just n -> fromIntegral n return journalPtr