utils

package
v0.0.0-...-f6108e4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: GPL-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 LogHandler

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

func StructuredLogHandler

func StructuredLogHandler(writer *os.File, appName string) *LogHandler

StructuredLogHandler returns a new LogHandler

func (*LogHandler) Enabled

func (h *LogHandler) Enabled(_ context.Context, level slog.Level) bool

Enabled method to indicate which log levels are enabled

func (*LogHandler) Handle

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

Handle implements the Handle method of the slog.Handler interface

func (*LogHandler) WithAttrs

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

WithAttrs implements the WithAttrs method of the slog.Handler interface

func (*LogHandler) WithGroup

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

WithGroup implements the WithGroup method of the slog.Handler interface

Jump to

Keyboard shortcuts

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