logger

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultLevel  slog.Level = slog.LevelInfo
	DefaultOutput io.Writer  = os.Stdout
)

Functions

func Default

func Default() *slog.Logger

func New

func New(cfg *Config, ow io.Writer) (*slog.Logger, error)

Types

type Config

type Config struct {
	Level  string `envconfig:"level" json:"level"`
	Format string `envconfig:"format" json:"format"`
	Output string `envconfig:"output" json:"output"`
}

func (*Config) SlogHandler

func (c *Config) SlogHandler(ow io.Writer) slog.Handler

func (*Config) SlogLevel

func (c *Config) SlogLevel() slog.Level

func (*Config) SlogOutput

func (c *Config) SlogOutput() io.Writer

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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