Documentation ¶
Overview ¶
Package journal provides a simplified journal API. The sdjournal library is quite lowlevel, the API provided here is a bit more high-level and more intuitive to use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry sdjournal.JournalEntry
Entry is a single entry from the journal.
func (*Entry) MatchString ¶
MatchString returns the entry formatted for matching. This includes the systemd unit name and the message only. If the systemd unit name is not available, this falls back to the command, and if that is also not available, the syslog identifier.
func (*Entry) ShortString ¶
ShortString returns the entry as a single line, very similar to a typical line from syslog.
func (*Entry) VerboseString ¶
VerboseString returns the entry formatted like journalctl's verbose output format, with one key-value-pair per line.
type Journal ¶
Journal is a handle for a journal to talk to.
func New ¶
New returns a handle to the journal the current user can read. For root, this is the system journal. For other users, this is usually just their own journal.
func (*Journal) Next ¶
Next returns the next entry. This entry is nil if the cursor is at the end of the journal.
func (*Journal) SeekCursor ¶
SeekCursor moves the current cursor past the element pointed to by the cursor name, so further reading proceeds after this last element.