Documentation ¶
Overview ¶
Package kmsg contains support for parsing Linux kernel log entries read from /dev/kmsg. These are the same log entries that can be read via the `dmesg` command. Each read from /dev/kmsg is guaranteed to return a single log entry, so no line-splitting is required.
More information can be found here: https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidFormat indicates the kmsg entry failed to parse. ErrInvalidFormat = errors.New("invalid kmsg format") )
Functions ¶
func ReadForever ¶
func ReadForever(logLevel LogLevel)
ReadForever reads from /dev/kmsg forever unless /dev/kmsg cannot be opened. Every entry with priority <= 'logLevel' will be logged.
Types ¶
type Entry ¶
type Entry struct { Priority LogLevel Facility uint8 Seq uint64 TimeSinceBootMicro uint64 Flags string Message string }
Entry is a single log entry in kmsg.
type LogLevel ¶
type LogLevel uint8
LogLevel represents the severity/priority of a log entry in the kernels ring buffer. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/kern_levels.h?id=HEAD