Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var L = MustNewLogger("", "", "", true, 0)
Functions ¶
func SetGlobalLogger ¶
func SetGlobalLogger(helper *Logger)
SetGlobalLogger set the global default logger
Types ¶
type Logger ¶
type Logger struct { // 为什么不直接把zap.Logger放出来,而是自己再对其Debug等函数再包装? // 主要是因为 kratos 切换到zap后,都是同一个堆栈调用的问题 *zap.Logger // contains filtered or unexported fields }
func MustNewLogger ¶
func MustNewLogger(serviceId, serviceName, serviceVersion string, development bool, callerSkip int) *Logger
MustNewLogger new zap Logger
func Trace ¶
Trace creates a child logger and adds trace&span id to it. Fields added to the child don't affect the parent, and vice versa.
func With ¶
With creates a child logger and adds structured context to it. Fields added to the child don't affect the parent, and vice versa.
Click to show internal directories.
Click to hide internal directories.