logger

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TextFormat Format = 0
	JsonFormat Format = 1
	LevelDebug Level  = Level(slog.LevelDebug)
	LevelInfo  Level  = Level(slog.LevelInfo)
	LevelWarn  Level  = Level(slog.LevelWarn)
	LevelError Level  = Level(slog.LevelError)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format uint8

type Level

type Level slog.Level

func (Level) Level

func (level Level) Level() slog.Level

func (Level) String

func (level Level) String() string

type LogKey

type LogKey string
const (
	Component LogKey = "component"
	Action    LogKey = "action"
)

func (LogKey) String

func (l LogKey) String() string

type Service

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

func New

func New(wr io.Writer, format Format, level Level) *Service

func NewNull

func NewNull() *Service

func NewWithDebugToStdout

func NewWithDebugToStdout() *Service

func (*Service) From

func (s *Service) From(component, action string) *slog.Logger

func (*Service) Request

func (s *Service) Request(id, method, path, ip, sessID string, status int, err error)

func (*Service) With

func (s *Service) With(args ...any) *slog.Logger

Jump to

Keyboard shortcuts

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