logger

package
v0.0.0-...-e21fa1a Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelTrace   = slog.Level(-8)
	LevelSuccess = slog.Level(6)
)

Variables

View Source
var LevelNames = map[slog.Leveler]string{
	LevelTrace:   "TRACE",
	LevelSuccess: "SUCCESS",
}

Functions

func PrintMessage

func PrintMessage[T LogMessageType](key string, value T) any

Types

type CustomLogger

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

func NewLogger

func NewLogger(options OptionsLogger) *CustomLogger

func (*CustomLogger) Debug

func (c *CustomLogger) Debug(msg string, args ...any)

func (*CustomLogger) Error

func (c *CustomLogger) Error(msg string, args ...any)

func (*CustomLogger) Info

func (c *CustomLogger) Info(msg string, args ...any)

func (*CustomLogger) Success

func (c *CustomLogger) Success(msg string, args ...any)

func (*CustomLogger) Warning

func (c *CustomLogger) Warning(msg string, args ...any)

type LogMessageType

type LogMessageType interface {
	int | int64 | float64 | string
}

type OptionsLogger

type OptionsLogger struct {
	Level      string
	AddSource  bool
	LoggerType string
}

type PrettyHandler

type PrettyHandler struct {
	slog.Handler
	// contains filtered or unexported fields
}

func (*PrettyHandler) Handle

func (h *PrettyHandler) Handle(_ context.Context, r slog.Record) error

type PrettyHandlerOptions

type PrettyHandlerOptions struct {
	SlogOpts slog.HandlerOptions
}

Jump to

Keyboard shortcuts

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