sysdjournaldslog

package
v5.2.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://wiki.archlinux.org/title/Systemd/Journal#Priority_level
	LevelDebug       = slog.LevelDebug
	LevelDebugStr    = "DEBUG"
	LevelInfo        = slog.LevelInfo
	LevelInfoStr     = "INFO"
	LevelNotice      = slog.Level(2)
	LevelNoticeStr   = "NOTICE"
	LevelWarning     = slog.LevelWarn
	LevelWarningStr  = "WARNING"
	LevelError       = slog.LevelError
	LevelErrorStr    = "ERROR"
	LevelCritical    = slog.Level(10)
	LevelCriticalStr = "CRITICAL"
	LevelAlert       = slog.Level(12)
	LevelAlertStr    = "ALERT"
	// LevelEmergency should not be used by applications
	LevelEmergency    = slog.Level(14)
	LevelEmergencyStr = "EMERGENCY"
)

Variables

This section is empty.

Functions

func GetAvailableLogLevels

func GetAvailableLogLevels() []string

GetAvailableLogLevels returns a list of available log levels that can be used by GetLogLevel()

func GetLogLevel

func GetLogLevel(raw string) slog.Leveler

GetLogLevel returns a log level based on the given string. If the string is not recognized, it will return LevelInfo.

func NewHandler

func NewHandler(logLevel slog.Leveler) slog.Handler

NewHandler returns a new slog handler that writes logs in a journald compatible/enhanced format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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