logs

package
v0.0.0-...-d03ac12 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func With

func With(ctx context.Context, logger Logger) context.Context

With returns a new context with the logger stored in it as a value

Types

type GormLogger

type GormLogger struct{}

func (GormLogger) Error

func (l GormLogger) Error(ctx context.Context, s string, i ...interface{})

func (GormLogger) Info

func (l GormLogger) Info(ctx context.Context, s string, i ...interface{})

func (GormLogger) LogMode

func (l GormLogger) LogMode(_ logger.LogLevel) logger.Interface

func (GormLogger) Trace

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

func (GormLogger) Warn

func (l GormLogger) Warn(ctx context.Context, s string, i ...interface{})

type Logger

type Logger = *zap.SugaredLogger

func Default

func Default() Logger

func From

func From(ctx context.Context) Logger

From returns a Logger which is stored in context as a value, if the Logger doesn't exist, it returns Default().WithCtx(ctx)

func SetLevel

func SetLevel(level string) Logger

func TryFrom

func TryFrom(ctx context.Context) (Logger, bool)

TryFrom returns a Logger which is stored in context as a value, if the Logger doesn't exist, it returns false.

Jump to

Keyboard shortcuts

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