vlog

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package vlog Copyright 2016-2023 chad.wang<chad.wang@icloudsky.com>. All rights reserved. Gorm日志与gogf框架日志进行融合

Package vlog Copyright 2016-2023 chad.wang<chad.wang@icloudsky.com>. All rights reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, v ...interface{})

func Debugf

func Debugf(ctx context.Context, format string, v ...interface{})

func Error

func Error(ctx context.Context, v ...interface{})

func Errorf

func Errorf(ctx context.Context, format string, v ...interface{})

func Info

func Info(ctx context.Context, v ...interface{})

func Infof

func Infof(ctx context.Context, format string, v ...interface{})

func NewGormLog

func NewGormLog(option ...GormLogOptions) logger.Interface

NewGormLog 定义数据库日志打印输出

func Warning

func Warning(ctx context.Context, v ...interface{})

func Warningf

func Warningf(ctx context.Context, format string, v ...interface{})

Types

type GormLogOptions

type GormLogOptions func(*GormLogger)

func GormLogWithName

func GormLogWithName(name ...string) GormLogOptions

GormLogWithName 日志名

func GormLogWithSlowThreshold

func GormLogWithSlowThreshold(st time.Duration) GormLogOptions

GormLogWithSlowThreshold 慢查询

type GormLogger

type GormLogger struct {
	SlowThreshold time.Duration // 慢查询时间,超过 SlowThreshold 就算慢查询
	Name          []string
}

func (GormLogger) Error

func (gl GormLogger) Error(ctx context.Context, s string, v ...interface{})

func (GormLogger) Info

func (gl GormLogger) Info(ctx context.Context, s string, v ...interface{})

func (GormLogger) LogMode

func (gl GormLogger) LogMode(level logger.LogLevel) logger.Interface

func (GormLogger) Trace

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

func (GormLogger) Warn

func (gl GormLogger) Warn(ctx context.Context, s string, v ...interface{})

Jump to

Keyboard shortcuts

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