log

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 16 Imported by: 45

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinLogger

func GinLogger() gin.HandlerFunc

func NewGORMLogger

func NewGORMLogger(conf gormlog.Config) gormlog.Interface

func SetLogLevel

func SetLogLevel(logLevel string)

func SetRootPath added in v0.1.3

func SetRootPath(path string)

Types

type CtxLogger added in v0.1.3

type CtxLogger interface {
	Logger
	For(ctx context.Context) Logger
}

func NewLogger

func NewLogger(pkg string) CtxLogger

func NewLoggerWithCallerLevel added in v0.1.3

func NewLoggerWithCallerLevel(pkg string, callerLevel int) CtxLogger

type GORMLogger

type GORMLogger struct {
	gormlog.Config
	// contains filtered or unexported fields
}

func (*GORMLogger) Error

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

func (*GORMLogger) Info

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

func (*GORMLogger) LogMode

func (l *GORMLogger) LogMode(logLevel gormlog.LogLevel) gormlog.Interface

func (*GORMLogger) Trace

func (l *GORMLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*GORMLogger) Warn

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

type Logger added in v0.1.3

type Logger interface {
	Debug(msg string, keysAndValues ...interface{})
	Warn(msg string, keysAndValues ...interface{})
	Info(msg string, keysAndValues ...interface{})
	Error(msg string, keysAndValues ...interface{})
	Fatal(msg string, keysAndValues ...interface{})
	Trace(msg string, keysAndValues ...interface{})
	With(keysAndValues ...interface{}) Logger
}

Jump to

Keyboard shortcuts

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