package kmsg
import "github.com/Microsoft/hcsshim/internal/guest/kmsg"
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 ¶
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
func (LogLevel) String ¶
Source Files ¶
- Version
- v0.12.9 (latest)
- Published
- Oct 30, 2024
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 14 hours ago –
Tools for package owners.