update
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Description : gorm v2 版本接口实现
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-03-01 9:52 下午
|
||||
package wrapper
|
||||
@ -24,7 +24,7 @@ import (
|
||||
|
||||
// NewGormV2 获取日志实例
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 9:56 下午 2021/3/1
|
||||
func NewGormV2(loggerLevel zapcore.Level, consoleOutput bool, encoder zapcore.Encoder, splitConfig *logger2.RotateLogConfig, traceIDField string, skip int) (logger.Interface, error) {
|
||||
@ -47,7 +47,7 @@ func NewGormV2(loggerLevel zapcore.Level, consoleOutput bool, encoder zapcore.En
|
||||
|
||||
// Gorm v2 版本库日志实现
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 9:55 下午 2021/3/1
|
||||
type Gorm struct {
|
||||
@ -58,7 +58,7 @@ type Gorm struct {
|
||||
|
||||
// LogMode ...
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:08 下午 2021/3/1
|
||||
func (g *Gorm) LogMode(level logger.LogLevel) logger.Interface {
|
||||
@ -67,7 +67,7 @@ func (g *Gorm) LogMode(level logger.LogLevel) logger.Interface {
|
||||
|
||||
// Info 日志
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:18 下午 2021/3/1
|
||||
func (g *Gorm) Info(ctx context.Context, s string, i ...interface{}) {
|
||||
@ -81,7 +81,7 @@ func (g *Gorm) Info(ctx context.Context, s string, i ...interface{}) {
|
||||
|
||||
// Warn ...
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:16 下午 2021/3/1
|
||||
func (g *Gorm) Warn(ctx context.Context, s string, i ...interface{}) {
|
||||
@ -95,7 +95,7 @@ func (g *Gorm) Warn(ctx context.Context, s string, i ...interface{}) {
|
||||
|
||||
// Error 日志
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:18 下午 2021/3/1
|
||||
func (g *Gorm) Error(ctx context.Context, s string, i ...interface{}) {
|
||||
@ -109,7 +109,7 @@ func (g *Gorm) Error(ctx context.Context, s string, i ...interface{}) {
|
||||
|
||||
// Trace Trace 记录
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:19 下午 2021/3/1
|
||||
func (g *Gorm) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) {
|
||||
@ -136,7 +136,7 @@ func (g *Gorm) Trace(ctx context.Context, begin time.Time, fc func() (string, in
|
||||
|
||||
// getTraceID 获取traceID
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:11 下午 2021/3/1
|
||||
func (g *Gorm) getTraceID(ctx context.Context) string {
|
||||
@ -145,7 +145,7 @@ func (g *Gorm) getTraceID(ctx context.Context) string {
|
||||
|
||||
// GetGormSQL 获取tracefn
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 10:38 下午 2021/3/1
|
||||
func GetGormSQL(dbClient *gorm.DB) func() (string, int64) {
|
||||
|
Reference in New Issue
Block a user