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

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

func NewGoRedisLogger

func NewGoRedisLogger(level int) redis.Hook

Types

type GoRedisLogger

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

func (*GoRedisLogger) AfterProcess

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

func (*GoRedisLogger) AfterProcessPipeline

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{})