slogsysloghandler

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

README

slog-syslog-handler

Syslog handler for slog logger

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(w SyslogLogger, writeJson bool, opts *slog.HandlerOptions) *slog.Logger

Types

type SyslogHandler

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

func NewSyslogHandler

func NewSyslogHandler(w SyslogLogger, writeJson bool, opts *slog.HandlerOptions) *SyslogHandler

func (*SyslogHandler) Enabled

func (h *SyslogHandler) Enabled(_ context.Context, l slog.Level) bool

func (*SyslogHandler) Handle

func (h *SyslogHandler) Handle(ctx context.Context, record slog.Record) error

func (*SyslogHandler) WithAttrs

func (h *SyslogHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*SyslogHandler) WithGroup

func (h *SyslogHandler) WithGroup(name string) slog.Handler

type SyslogLogger

type SyslogLogger interface {
	Debug(string) error
	Info(string) error
	Notice(string) error
	Warning(string) error
	Err(string) error
	Crit(string) error
}

Jump to

Keyboard shortcuts

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