logger

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBFmtWithError   = "%s\n\033[36;1m[%.2fms]\033[0m %s\n\033[36;31m[%d rows affected or returned]\033[0m \n\u001B[31;1m%s\u001B[0m"
	DBFmtWithNoError = "%s\n\033[36;1m[%.2fms]\033[0m %s\n\033[36;31m[%d rows affected or returned]\033[0m"
)

Variables

This section is empty.

Functions

func Hijacker

func Hijacker(ctx *pio.Ctx)

func NewDBLogger added in v1.0.7

func NewDBLogger(callback func(sql, file string, rows int64, msElapsed float64), leave gormLogger.LogLevel, slowThreshold time.Duration) gormLogger.Interface

func NewGoRedisLogger added in v1.0.15

func NewGoRedisLogger(level int) redis.Hook

Types

type GoRedisLogger added in v1.0.14

type GoRedisLogger struct {
	redisext.OpenTelemetryHook
	// contains filtered or unexported fields
}

func (*GoRedisLogger) AfterProcess added in v1.0.14

func (cl *GoRedisLogger) AfterProcess(ctx context.Context, cmd redis.Cmder) error

func (*GoRedisLogger) AfterProcessPipeline added in v1.0.14

func (cl *GoRedisLogger) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error

type MyDBLogger

type MyDBLogger struct {
	SuccessCallback func(sql string, source string, rows int, duration float64)
	FailCallback    func(source string, msg ...interface{})
	Logout          bool
}

func (*MyDBLogger) Print

func (logger *MyDBLogger) Print(values ...interface{})

Jump to

Keyboard shortcuts

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