log

package
v0.0.0-...-8553d44 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

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

func CheckLogTag(tag string) bool

func DB

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

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

func SLogger() *zap.SugaredLogger

func Service

func Service(module, name, version, userId 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

type GameSpan struct {
	Span
	Tag string
}

GameSpan 游戏级别的span

type Span

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

type SystemSpan

type SystemSpan struct {
	Span
}

SystemSpan 系统级别的span

type TaggedCore

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

func (*TaggedCore) Check

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

func (*TaggedCore) Enabled

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

func (*TaggedCore) Sync

func (t *TaggedCore) Sync() error

func (*TaggedCore) With

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

func (*TaggedCore) Write

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

type Trace

type Trace struct {
}

type UserSpan

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