Documentation ¶
Index ¶
- Constants
- func CheckDLTag(dltag string) string
- func GetEncoder() zapcore.Encoder
- func GetLogWriter(filename string, maxSize, maxBackup, maxAge int) zapcore.WriteSyncer
- func GetTraceID() (traceID string)
- func NewSpanID() string
- type Logger
- func (l *Logger) DPanic(msg string, trace *TraceContext, dltag string, m map[string]interface{})
- func (l *Logger) Debug(msg string, trace *TraceContext, dltag string, m map[string]interface{})
- func (l *Logger) Error(msg string, trace *TraceContext, dltag string, m map[string]interface{})
- func (l *Logger) Fatal(msg string, trace *TraceContext, dltag string, m map[string]interface{})
- func (l *Logger) Info(msg string, trace *TraceContext, dltag string, m map[string]interface{})
- func (l *Logger) Panic(msg string, trace *TraceContext, dltag string, m map[string]interface{})
- func (l *Logger) Warn(msg string, trace *TraceContext, dltag string, m map[string]interface{})
- type Trace
- type TraceContext
Constants ¶
View Source
const ( DLTagUndefind = "_undef" DLTagMySQLFailed = "_com_mysql_failure" DLTagRedisFailed = "_com_redis_failure" DLTagMySQLSuccess = "_com_mysql_success" DLTagRedisSuccess = "_com_redis_success" DLTagThriftFailed = "_com_thrift_failure" DLTagThriftSuccess = "_com_thrift_success" DLTagHTTPSuccess = "_com_http_success" DLTagHTTPFailed = "_com_http_failure" DLTagTCPFailed = "_com_tcp_failure" DLTagRequestIn = "_com_request_in" DLTagRequestOut = "_com_request_out" )
通用DLTag常量定义
Variables ¶
This section is empty.
Functions ¶
func GetLogWriter ¶
func GetLogWriter(filename string, maxSize, maxBackup, maxAge int) zapcore.WriteSyncer
GetLogWriter 分割归档
Types ¶
type Logger ¶
Logger 全局变量
var Log *Logger
Log 全局日志实例
func (*Logger) DPanic ¶
func (l *Logger) DPanic(msg string, trace *TraceContext, dltag string, m map[string]interface{})
DPanic DPanic 级别日志
func (*Logger) Debug ¶
func (l *Logger) Debug(msg string, trace *TraceContext, dltag string, m map[string]interface{})
Debug debug 级别日志
func (*Logger) Error ¶
func (l *Logger) Error(msg string, trace *TraceContext, dltag string, m map[string]interface{})
Error error 级别日志
func (*Logger) Fatal ¶
func (l *Logger) Fatal(msg string, trace *TraceContext, dltag string, m map[string]interface{})
Fatal Fatal 级别日志
func (*Logger) Info ¶
func (l *Logger) Info(msg string, trace *TraceContext, dltag string, m map[string]interface{})
Info Info级别日志
type Trace ¶
type Trace struct { TraceID string SpandID string Caller string SrcMethod string HintContent string HintCode int64 }
Trace 链路日志结构体
type TraceContext ¶
TraceContext 链路日志上下文信息
Click to show internal directories.
Click to hide internal directories.