kmsg

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KLogLevel

type KLogLevel uintptr

KLogLevel represents the log levels for kernel logging.

const (
	KLogEmergency KLogLevel = 0
	KLogAlert     KLogLevel = 1
	KLogCritical  KLogLevel = 2
	KLogError     KLogLevel = 3
	KLogWarning   KLogLevel = 4
	KLogNotice    KLogLevel = 5
	KLogInfo      KLogLevel = 6
	KLogDebug     KLogLevel = 7
)

Log levels as defined by the kernel syslog

type KmsgHandler

type KmsgHandler struct {
	// contains filtered or unexported fields
}

KmsgHandler is a slog.Handler that writes log messages to the kernel log.

func NewKmsgHandler

func NewKmsgHandler(f *os.File, opts *slog.HandlerOptions) *KmsgHandler

func (*KmsgHandler) Enabled

func (kh *KmsgHandler) Enabled(_ context.Context, level slog.Level) bool

func (*KmsgHandler) Handle

func (kh *KmsgHandler) Handle(_ context.Context, r slog.Record) error

func (*KmsgHandler) WithAttrs

func (kh *KmsgHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*KmsgHandler) WithGroup

func (kh *KmsgHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL