logger

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, args ...any)

func Error

func Error(msg string, args ...any)

func Info

func Info(msg string, args ...any)

func NewCustomHandler

func NewCustomHandler(writer io.Writer, opts *slog.HandlerOptions) slog.Handler

NewCustomHandler creates a new instance of CustomHandler

func NewCustomLogger

func NewCustomLogger() *slog.Logger

func Warn

func Warn(msg string, args ...any)

Types

type CustomHandler

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

CustomHandler implements the slog.Handler interface

func (*CustomHandler) Enabled

func (h *CustomHandler) Enabled(ctx context.Context, level slog.Level) bool

Enabled checks if a log level is enabled

func (*CustomHandler) Handle

func (h *CustomHandler) Handle(ctx context.Context, r slog.Record) error

Handle writes log records in the desired format

func (*CustomHandler) WithAttrs

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

WithAttrs returns a new handler with additional attributes (not used here)

func (*CustomHandler) WithGroup

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

WithGroup returns a new handler with a specified group (not used here)

Jump to

Keyboard shortcuts

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