logger

package
v0.0.0-...-822122e Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 2 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 GetLogger

func GetLogger() *slog.Logger

func Info

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

func Init

func Init(config Config)

func Warn

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

Types

type Attr

type Attr = slog.Attr

func Bool

func Bool(key string, value bool) Attr

func Float64

func Float64(key string, value float64) Attr

func Int

func Int(key string, value int) Attr

func String

func String(key string, value string) Attr

type Config

type Config struct {
	Level   Level
	Handler Handler
}

type Handler

type Handler string
const (
	Text Handler = "text"
	Json Handler = "json"
)

type Level

type Level string
const (
	DebugLevel Level = "debug"
	WarnLevel  Level = "warn"
	ErrorLevel Level = "error"
	InfoLevel  Level = "info"
)

Jump to

Keyboard shortcuts

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