Help us shape the future of Go! Take the 2026 Go Developer Survey

logger

package
v1.20.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatterText = "text"
	FormatterJson = "json"
)

Formatter types for log output

Variables

This section is empty.

Functions

func GetLevelFromString

func GetLevelFromString(level string) log.Level

GetLevelFromString converts a string log level to log.Level.

func NewRotatingFileHandler

func NewRotatingFileHandler(w io.Writer, config config.Config, json foundation.Json, level slog.Leveler, formatter string) log.Handler

Types

type ConsoleHandler

type ConsoleHandler struct {
	*IOHandler
}

func NewConsoleHandler

func NewConsoleHandler(config config.Config, json foundation.Json, level slog.Leveler, formatter string) *ConsoleHandler

type Daily

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

func NewDaily

func NewDaily(config config.Config, json foundation.Json) *Daily

func (*Daily) Handle

func (daily *Daily) Handle(channel string) (log.Handler, error)

type IOHandler

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

func NewIOHandler

func NewIOHandler(w io.Writer, config config.Config, json foundation.Json, level slog.Leveler, formatter string) *IOHandler

func (*IOHandler) Enabled

func (h *IOHandler) Enabled(level log.Level) bool

Enabled reports whether the given level is enabled.

func (*IOHandler) Handle

func (h *IOHandler) Handle(entry log.Entry) error

Handle handles the Record.

type Single

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

func NewSingle

func NewSingle(config config.Config, json foundation.Json) *Single

func (*Single) Handle

func (single *Single) Handle(channel string) (log.Handler, error)

type StackTrace

type StackTrace struct {
	Root struct {
		Message string   `json:"message"`
		Stack   []string `json:"stack"`
	} `json:"root"`
	Wrap []struct {
		Message string `json:"message"`
		Stack   string `json:"stack"`
	} `json:"wrap"`
}

Jump to

Keyboard shortcuts

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