- """Return dictionary of the next log entry. Optional skip value
- will return the `skip`th log entry.
- Returned will be journal entry dictionary processed with
- converters."""
- return self._convert_entry(
- super(Journal, self).get_next(skip))
+ """Return the next log entry as a mapping type, currently
+ a standard dictionary of fields.
+
+ Optional skip value will return the `skip`\-th log entry.
+
+ Entries will be processed with converters specified during
+ Reader creation.
+ """
+ if super(Reader, self)._next(skip):
+ entry = super(Reader, self)._get_all()
+ if entry:
+ entry['__REALTIME_TIMESTAMP'] = self._get_realtime()
+ entry['__MONOTONIC_TIMESTAMP'] = self._get_monotonic()
+ entry['__CURSOR'] = self._get_cursor()
+ return self._convert_entry(entry)
+ return dict()
+
+ def get_previous(self, skip=1):
+ """Return the previous log entry as a mapping type,
+ currently a standard dictionary of fields.
+
+ Optional skip value will return the -`skip`\-th log entry.
+
+ Entries will be processed with converters specified during
+ Reader creation.
+
+ Equivalent to get_next(-skip).
+ """
+ return self.get_next(-skip)