logging

package
v0.0.0-...-c78e9a6 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: LGPL-2.1 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSubModule

func InitSubModule()

func NewErrReport

func NewErrReport(err error, skipStacktrace bool) *errReport

func NewJsonCodec

func NewJsonCodec(skipStacktrace bool) errors.Codec

NewJsonCodec encodes error data as JSON documents. If `pretty` is set to `true` the output will be indented for readability.

func NewSloggerWithCorrectCallDepth

func NewSloggerWithCorrectCallDepth(level slog.Leveler, callDepth int) *slog.Logger

Types

type Attr

type Attr map[string]any

type Level

type Level string
const (
	LevelDebug Level = "debug"
	LevelInfo  Level = "info"
	LevelWarn  Level = "warn"
	LevelError Level = "error"
)

type LoggerService

type LoggerService interface {
	InnerLogger() any
	Clone() LoggerService
	Level() Level
	SetLevel(lvl Level)
	SetContext(key string, value string)
	GetContext(key string) string
	RemoveContext(key string)
	Debug(message string, data Attr)
	Debugf(format string, args ...any)
	Info(message string, data Attr)
	Infof(format string, args ...any)
	Warn(message string, data Attr)
	Warnf(format string, args ...any)
	Error(message string, err error)
	Errorf(format string, args ...any)
}

func Logger

func Logger() LoggerService

func NewLogger

func NewLogger(levels ...Level) LoggerService

Jump to

Keyboard shortcuts

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