log

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Overview

Package log @Description: log包,日志相关业务 @Link https://github.com/natefinch/lumberjack @Link https://github.com/uber-go/zap

@Ref https://www.cnblogs.com/stulzq/p/16741844.html

Index

Constants

View Source
const (
	GAMETAG    = "game"
	DBTAG      = "db"
	SERVICETAG = "service"
)

Variables

This section is empty.

Functions

func CheckLogTag added in v1.0.8

func CheckLogTag(tag string) bool

func DB added in v1.0.9

func DB(traceId, dbName, script string, count int32)

func Debug

func Debug(msg string, params ...interface{})

func DebugTag

func DebugTag(tag string, msg string, params ...interface{})

func Error

func Error(msg string, params ...interface{})

func ErrorTag

func ErrorTag(tag string, msg string, params ...interface{})

func Game added in v1.0.9

func Game(userId, tag, msg string, params ...interface{})

func Info

func Info(msg string, params ...interface{})

func InfoTag

func InfoTag(tag string, msg string, params ...interface{})

func SLogger added in v1.0.9

func SLogger() *zap.SugaredLogger

func Service added in v1.0.9

func Service(module, name, version, userId, args, reply string, consume int64, code int32)

func Warn

func Warn(msg string, params ...interface{})

func WarnTag

func WarnTag(tag string, msg string, params ...interface{})

Types

type GameSpan added in v1.0.9

type GameSpan struct {
	Span
	Tag string
}

GameSpan 游戏级别的span

type Span added in v1.0.9

type Span struct {
	TraceId    string // 跟踪id
	SourceNode string // 发起节点
	TargetNode string // 目标节点
	StartTime  int64  // 开始时间
}

type SystemSpan added in v1.0.9

type SystemSpan struct {
	Span
}

SystemSpan 系统级别的span

type TaggedCore added in v1.0.9

type TaggedCore struct {
	Core        zapcore.Core
	Tag         string
	AllowedTags map[string]zapcore.Core
}

func (*TaggedCore) Check added in v1.0.9

func (t *TaggedCore) Check(entry zapcore.Entry, checkedEntry *zapcore.CheckedEntry) *zapcore.CheckedEntry

func (*TaggedCore) Enabled added in v1.0.9

func (t *TaggedCore) Enabled(lvl zapcore.Level) bool

func (*TaggedCore) Sync added in v1.0.9

func (t *TaggedCore) Sync() error

func (*TaggedCore) With added in v1.0.9

func (t *TaggedCore) With(fields []zapcore.Field) zapcore.Core

func (*TaggedCore) Write added in v1.0.9

func (t *TaggedCore) Write(entry zapcore.Entry, fields []zapcore.Field) error

type Trace added in v1.0.9

type Trace struct {
}

type UserSpan added in v1.0.9

type UserSpan struct {
	Span
	UserId string
}

UserSpan 用户级别的span

Jump to

Keyboard shortcuts

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