slog

package
v1.1.42 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

func New

func New(opts ...Option) *Logger

func NewSlogJsonLogger

func NewSlogJsonLogger(w io.Writer, opts ...Option) *Logger

func NewSlogTextLogger

func NewSlogTextLogger(w io.Writer, opts ...Option) *Logger

func NewWithHandler

func NewWithHandler(handler slog.Handler, opt *slog.HandlerOptions, opts ...Option) *Logger

func (*Logger) Debugc

func (l *Logger) Debugc(ctx context.Context, msg string, v ...any)

func (*Logger) Debugf

func (l *Logger) Debugf(msg string, v ...any)

func (*Logger) Enable

func (l *Logger) Enable(lev level.Level)

func (*Logger) Errorc

func (l *Logger) Errorc(ctx context.Context, msg string, v ...any)

func (*Logger) Errorf

func (l *Logger) Errorf(msg string, v ...any)

func (*Logger) Fatalc added in v1.0.25

func (l *Logger) Fatalc(ctx context.Context, msg string, v ...any)

func (*Logger) Fatalf

func (l *Logger) Fatalf(msg string, v ...any)

func (*Logger) Infoc

func (l *Logger) Infoc(ctx context.Context, msg string, v ...any)

func (*Logger) Infof

func (l *Logger) Infof(msg string, v ...any)

func (*Logger) IsDebug

func (l *Logger) IsDebug() bool

func (*Logger) PanicError

func (l *Logger) PanicError(err error, v ...any)

func (*Logger) SetOutput

func (l *Logger) SetOutput(w io.Writer)

func (*Logger) Warnc

func (l *Logger) Warnc(ctx context.Context, msg string, v ...any)

func (*Logger) Warnf

func (l *Logger) Warnf(msg string, v ...any)

type Option

type Option func(*Logger)

func WithCalldepth

func WithCalldepth(d int) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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