packages feed

journalctl-stream 0.2.0.0 → 0.3.0.0

raw patch · 3 files changed

+11/−7 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Systemd.Journalctl.Stream: Entry :: ProcessID -> Text -> Maybe Text -> Text -> FilePath -> Cursor -> POSIXTime -> Maybe Text -> Text -> Entry
+ Systemd.Journalctl.Stream: Entry :: Maybe ProcessID -> Text -> Maybe Text -> Maybe Text -> Maybe FilePath -> Cursor -> POSIXTime -> Maybe Text -> Text -> Entry
- Systemd.Journalctl.Stream: [entryExecutable] :: Entry -> FilePath
+ Systemd.Journalctl.Stream: [entryExecutable] :: Entry -> Maybe FilePath
- Systemd.Journalctl.Stream: [entryPID] :: Entry -> ProcessID
+ Systemd.Journalctl.Stream: [entryPID] :: Entry -> Maybe ProcessID
- Systemd.Journalctl.Stream: [entryProcess] :: Entry -> Text
+ Systemd.Journalctl.Stream: [entryProcess] :: Entry -> Maybe Text

Files

changelog.md view
@@ -1,3 +1,7 @@+## 0.3.0.0+* Fix for fields: `entryPID`, `entryProcess`, `entryExecutable`.+  They are optional now, as they should have been.+ ## 0.2.0.0 * Added new fields: `entryNamespace`, `entryProcess`, `entryExecutable`. 
journalctl-stream.cabal view
@@ -2,7 +2,7 @@ category: System synopsis: Stream logs using journalctl. description: Stream logs using journalctl. Check the documentation for more details.-version: 0.2.0.0+version: 0.3.0.0 author: Daniel Casanueva (daniel.casanueva `at` proton.me) maintainer: Daniel Casanueva (daniel.casanueva `at` proton.me) license: MIT
lib/Systemd/Journalctl/Stream.hs view
@@ -49,15 +49,15 @@ -- | A journal entry. data Entry = Entry   { -- | Process ID.-    entryPID :: ProcessID+    entryPID :: Maybe ProcessID     -- | The name of the originating host.   , entryHostname :: Text     -- | Namespace identifier.   , entryNamespace :: Maybe Text     -- | Process name.-  , entryProcess :: Text+  , entryProcess :: Maybe Text     -- | File path to the executable.-  , entryExecutable :: FilePath+  , entryExecutable :: Maybe FilePath     -- | The cursor for the entry.   , entryCursor :: Cursor     -- | The time the entry was received by the journal.@@ -86,11 +86,11 @@  instance FromJSON Entry where   parseJSON = JSON.withObject "Entry" $ \o -> Entry-    <$> (CPid . asText <$> o .: "_PID")+    <$> (fmap (CPid . asText) <$> o .:? "_PID")     <*> o .: "_HOSTNAME"     <*> o .:? "_NAMESPACE"-    <*> o .: "_COMM"-    <*> o .: "_EXE"+    <*> o .:? "_COMM"+    <*> o .:? "_EXE"     <*> o .: "__CURSOR"     <*> (secondsToNominalDiffTime . (/1000000) . asText <$> o .: "__REALTIME_TIMESTAMP")     <*> o .:? "UNIT"