wrapper

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package wrapper...

Description : gorm v2 版本接口实现

Author : go_developer@163.com<白茶清欢>

Date : 2021-03-01 9:52 下午

Package wrapper...

Description : http_gin 使用gin框架时的,记录日志

Author : go_developer@163.com<白茶清欢>

Date : 2021-01-03 3:43 下午

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGormSQL

func GetGormSQL(dbClient *gorm.DB) func() (string, int64)

GetGormSQL 获取tracefn

Author : go_developer@163.com<白茶清欢>

Date : 10:38 下午 2021/3/1

func NewGormV2

func NewGormV2(loggerLevel zapcore.Level, consoleOutput bool, encoder zapcore.Encoder, splitConfig *logger2.RotateLogConfig, traceIDField string, skip int) (logger.Interface, error)

NewGormV2 获取日志实例

Author : go_developer@163.com<白茶清欢>

Date : 9:56 下午 2021/3/1

Types

type Gin

type Gin struct {
	// contains filtered or unexported fields
}

Gin 包装gin实例

Author : go_developer@163.com<白茶清欢>

Date : 3:59 下午 2021/1/3

func NewGinLogger

func NewGinLogger(loggerLevel zapcore.Level, consoleOutput bool, encoder zapcore.Encoder, splitConfig *logger.RotateLogConfig, extractFieldList []string, skip int) (*Gin, error)

NewGinLogger 使用gin框架记录日志

Author : go_developer@163.com<白茶清欢>

Date : 3:45 下午 2021/1/3

func (*Gin) DPanic

func (gw *Gin) DPanic(ginCtx *gin.Context, msg string, field ...zap.Field)

DPanic 日志

Author : go_developer@163.com<白茶清欢>

Date : 4:30 下午 2021/1/3

func (*Gin) Debug

func (gw *Gin) Debug(ginCtx *gin.Context, msg string, field ...zap.Field)

Debug 日志

Author : go_developer@163.com<白茶清欢>

Date : 4:14 下午 2021/1/3

func (*Gin) Error

func (gw *Gin) Error(ginCtx *gin.Context, msg string, field ...zap.Field)

Error 日志

Author : go_developer@163.com<白茶清欢>

Date : 4:29 下午 2021/1/3

func (*Gin) GetZapLoggerInstance

func (gw *Gin) GetZapLoggerInstance() *zap.Logger

GetZapLoggerInstance 获取zap日志实例

Author : go_developer@163.com<白茶清欢>

Date : 2021/01/03 22:56:47

func (*Gin) Info

func (gw *Gin) Info(ginCtx *gin.Context, msg string, field ...zap.Field)

Info 日志

Author : go_developer@163.com<白茶清欢>

Date : 4:28 下午 2021/1/3

func (*Gin) Panic

func (gw *Gin) Panic(ginCtx *gin.Context, msg string, field ...zap.Field)

Panic 日志

Author : go_developer@163.com<白茶清欢>

Date : 4:29 下午 2021/1/3

func (*Gin) Warn

func (gw *Gin) Warn(ginCtx *gin.Context, msg string, field ...zap.Field)

Warn 日志

Author : go_developer@163.com<白茶清欢>

Date : 4:29 下午 2021/1/3

type Gorm

type Gorm struct {
	// contains filtered or unexported fields
}

Gorm v2 版本库日志实现

Author : go_developer@163.com<白茶清欢>

Date : 9:55 下午 2021/3/1

func (*Gorm) Error

func (g *Gorm) Error(ctx context.Context, s string, i ...interface{})

Error 日志

Author : go_developer@163.com<白茶清欢>

Date : 10:18 下午 2021/3/1

func (*Gorm) Info

func (g *Gorm) Info(ctx context.Context, s string, i ...interface{})

Info 日志

Author : go_developer@163.com<白茶清欢>

Date : 10:18 下午 2021/3/1

func (*Gorm) LogMode

func (g *Gorm) LogMode(level logger.LogLevel) logger.Interface

LogMode ...

Author : go_developer@163.com<白茶清欢>

Date : 10:08 下午 2021/3/1

func (*Gorm) Trace

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

Trace Trace 记录

Author : go_developer@163.com<白茶清欢>

Date : 10:19 下午 2021/3/1

func (*Gorm) Warn

func (g *Gorm) Warn(ctx context.Context, s string, i ...interface{})

Warn ...

Author : go_developer@163.com<白茶清欢>

Date : 10:16 下午 2021/3/1

Jump to

Keyboard shortcuts

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