xslog

package
v0.0.0-...-4d27eac Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileSlog

func NewFileSlog(c *Config) *slog.Logger

Types

type Config

type Config struct {
	FileDir    string `yaml:"FileDir"`
	MaxSize    int    `yaml:"MaxSize"`
	MaxBackups int    `yaml:"MaxBackups"`
	MaxAge     int    `yaml:"MaxAge"`
	Compress   bool   `yaml:"Compress"`
	LocalTime  bool   `yaml:"LocalTime"`
	AddSource  bool   `yaml:"AddSource"`

	Level        slog.Level
	ExtraWriters []ExtraWriter
	ReplaceAttr  func(groups []string, a slog.Attr) slog.Attr
}

func (*Config) SetLevel

func (c *Config) SetLevel(level slog.Level) *Config

type ExtraWriter

type ExtraWriter struct {
	Writer io.Writer
	Level  slog.Level
}

Jump to

Keyboard shortcuts

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