Documentation ¶
Index ¶
- Constants
- func Debug(traceID string, msg string, kv ...*Pair)
- func Error(traceID string, msg string, kv ...*Pair)
- func Exit()
- func Fatal(traceID string, msg string, kv ...*Pair)
- func Info(traceID string, msg string, kv ...*Pair)
- func Log(e *Entry)
- func Notice(traceID string, msg string, kv ...*Pair)
- func RegisterProcessors(caller, async bool, procs ...*Processor) bool
- func Trace(traceID string, msg string, kv ...*Pair)
- func Warn(traceID string, msg string, kv ...*Pair)
- type Entry
- type Formotter
- type Level
- type Pair
- type Persister
- type Processor
Constants ¶
View Source
const InvalidTID = ""
InvalidTID 无效的tracingID,代表该条日志tracingID无效
Variables ¶
This section is empty.
Functions ¶
func RegisterProcessors ¶
RegisterProcessors 注册处理器,一旦开始打日志就不能再调用! caller: 自动获取调用者信息(影响性能) async: 持久化日志时 使用异步的任务队列 procs: 一组包含 格式化器和持久化器组 的处理器组
Types ¶
type Entry ¶
type Entry struct { //Data 日志数据 Data []*Pair // Time 日志创建时间 Time time.Time // Level 本条日志所属级别 Level Level // Caller 日志打印函数的调用方,包含 包名.函数(或文件名) 和行号 Caller struct { File string Line int } // TraceID 日志的追踪ID,通常为用户名或事务ID等 TraceID string // Message 日志的概述 Message string }
Entry 一条日志的所有信息
Click to show internal directories.
Click to hide internal directories.