func Enabled() bool
Enabled checks whether the local systemd journal is available for logging.
func Print(priority Priority, format string, a ...interface{}) error
Print prints a message to the local systemd journal using Send().
func Send(message string, priority Priority, vars map[string]string) error
Send a message to the local systemd journal. vars is a map of journald fields to values. Fields must be composed of uppercase letters, numbers, and underscores, but must not start with an underscore. Within these restrictions, any arbitrary field name may be used. Some names have special significance: see the journalctl documentation (http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html) for more details. vars may be nil.
func StderrIsJournalStream() (bool, error)
StderrIsJournalStream returns whether the process stderr is connected to the Journal's stream transport.
This can be used for automatic protocol upgrading described in Journal Native Protocol.
Returns true if JOURNAL_STREAM environment variable is present, and stderr's device and inode numbers match it.
Error is returned if unexpected error occurs: e.g. if JOURNAL_STREAM environment variable is present, but malformed, fstat syscall fails, etc.
▹ Example
func StdoutIsJournalStream() (bool, error)
StdoutIsJournalStream returns whether the process stdout is connected to the Journal's stream transport.
Returns true if JOURNAL_STREAM environment variable is present, and stdout's device and inode numbers match it.
Error is returned if unexpected error occurs: e.g. if JOURNAL_STREAM environment variable is present, but malformed, fstat syscall fails, etc.
Most users should probably use StderrIsJournalStream.
Priority of a journal message
type Priority int
const ( PriEmerg Priority = iota PriAlert PriCrit PriErr PriWarning PriNotice PriInfo PriDebug )