log

package
v0.0.0-...-5aa5535 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) *slog.Logger

func WithContext

func WithContext(ctx context.Context, logger *slog.Logger, args ...interface{}) context.Context

Types

type BadgerLogger

type BadgerLogger struct{}

func (*BadgerLogger) Debugf

func (b *BadgerLogger) Debugf(msg string, args ...interface{})

func (*BadgerLogger) Errorf

func (b *BadgerLogger) Errorf(msg string, args ...interface{})

func (*BadgerLogger) Infof

func (b *BadgerLogger) Infof(msg string, args ...interface{})

func (*BadgerLogger) Warningf

func (b *BadgerLogger) Warningf(msg string, args ...interface{})

type GormLogger

type GormLogger struct{}

func (*GormLogger) Error

func (g *GormLogger) Error(ctx context.Context, msg string, data ...interface{})

func (*GormLogger) Info

func (g *GormLogger) Info(ctx context.Context, msg string, data ...interface{})

func (*GormLogger) LogMode

func (g *GormLogger) LogMode(level logger.LogLevel) logger.Interface

func (*GormLogger) Trace

func (g *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)

func (*GormLogger) Warn

func (g *GormLogger) Warn(ctx context.Context, msg string, data ...interface{})

type TextHandler

type TextHandler struct {
	slog.Handler
	// contains filtered or unexported fields
}

func NewTextHandler

func NewTextHandler(
	out io.Writer,
	opts *slog.HandlerOptions,
) *TextHandler

func (*TextHandler) Handle

func (h *TextHandler) Handle(ctx context.Context, r slog.Record) error

func (*TextHandler) WithAttrs

func (h *TextHandler) WithAttrs(attrs []slog.Attr) slog.Handler

type TextHandlerOptions

type TextHandlerOptions struct {
	SlogOpts *slog.HandlerOptions
}

Jump to

Keyboard shortcuts

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