logger

package
v0.0.0-...-9b971e3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REQ_START       = "请求开始"
	REQ_PARAMS      = "请求参数"
	REQ_RTNS        = "请求返回值"
	REQ_END         = "请求结束"
	REQ_PARAMS_ERR  = "请求参数不合法"
	FUNC_START      = "函数开始"
	FUNC_PARAMS     = "函数参数"
	FUNC_RTNS       = "函数返回值"
	FUNC_END        = "函数结束"
	FUNC_PARAMS_ERR = "函数参数不合法"
	DATA_ERR        = "参数中<data>格式错误"
	REC_NEW         = "新增"
	REC_CHG         = "更新"
	REC_DEL         = "删除"
	REC_QRY         = "查询"
	SQL_QRY         = "查询语句"
)

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, logType, msg, memo string)

func Error

func Error(ctx context.Context, logType string, err error, memo string)

func Fatal

func Fatal(msg string, fields ...LogField)

func Info

func Info(ctx context.Context, logType, msg, memo string)

func Init

func Init()

func JSON

func JSON(ctx context.Context, logType string, obj interface{}, memo string)

func NewLogger

func NewLogger(logFile string, logLevelName string)

NewLogger 初始化日志

func Panic

func Panic(msg error, fields ...LogField)

func Warn

func Warn(ctx context.Context, logType string, msg, memo string)

Types

type LogField

type LogField = zap.Field

隔离引用

func Any

func Any(key string, value interface{}) LogField

func Bool

func Bool(key string, val bool) LogField

func ByteString

func ByteString(key string, val []byte) LogField

func Duration

func Duration(key string, val time.Duration) LogField

func Float32

func Float32(key string, val float32) LogField

func Float64

func Float64(key string, val float64) LogField

func Int

func Int(key string, val int) LogField

func Int32

func Int32(key string, val int32) LogField

func Int64

func Int64(key string, val int64) LogField

func String

func String(key string, val string) LogField

func Time

func Time(key string, val time.Time) LogField

func Uintptr

func Uintptr(key string, val uintptr) LogField

Jump to

Keyboard shortcuts

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