Documentation
¶
Index ¶
- Variables
- func BufferedWriteSyncer(filename string, maxSize, maxBackups, maxAge int) *zapcore.BufferedWriteSyncer
- func Debug(msg string, args ...any)
- func Debugf(format string, args ...any)
- func Error(msg string, args ...any)
- func Errorf(format string, args ...any)
- func G() *slog.Logger
- func Info(msg string, args ...any)
- func Infof(format string, args ...any)
- func New(filename string, ws ...io.Writer) error
- func NewMultiHandler(hs ...slog.Handler) slog.Handler
- func NewV2(ws []io.Writer, opts *slog.HandlerOptions)
- func Sync()
- func Warn(msg string, args ...any)
- func Warnf(format string, args ...any)
- type Config
- type MultiHandler
- type Option
- type OptionFunc
- type PrettyHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Log = slog.New(NewPrettyHandler(nil))
)
Functions ¶
func BufferedWriteSyncer ¶
func BufferedWriteSyncer(filename string, maxSize, maxBackups, maxAge int) *zapcore.BufferedWriteSyncer
Types ¶
type MultiHandler ¶
type MultiHandler struct {
// contains filtered or unexported fields
}
type Option ¶
type Option interface {
Apply(cfg *Config)
}
func WithHandlerOptions ¶
func WithHandlerOptions(opts *slog.HandlerOptions) Option
func WithOutput ¶
type OptionFunc ¶
type OptionFunc func(cfg *Config)
func (OptionFunc) Apply ¶
func (fn OptionFunc) Apply(cfg *Config)
type PrettyHandler ¶
type PrettyHandler struct {
// contains filtered or unexported fields
}
func NewPrettyHandler ¶
func NewPrettyHandler(opts *slog.HandlerOptions) *PrettyHandler
Click to show internal directories.
Click to hide internal directories.