Documentation
¶
Index ¶
- func DPanic(msg string, options map[string]interface{})
- func Debug(msg string, options map[string]interface{})
- func Error(msg string, options map[string]interface{})
- func Fatal(msg string, options map[string]interface{})
- func Info(msg string, options map[string]interface{})
- func InitLogger(skip ...int)
- func LogCompress(b bool)
- func LogLevel(lvl string)
- func LogSugar() *zap.SugaredLogger
- func MaxAge(n int)
- func MaxSize(n int)
- func Panic(msg string, options map[string]interface{})
- func Recover()
- func SetLogDir(dir string)
- func SetLogFile(fileName string)
- func Warn(msg string, options map[string]interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
func InitLogger(skip ...int)
InitLogger 初始化fLogger句柄,skip指定显示文件名和行号的层级 skip 大于0会调用zap.AddCallerSkip Caller(skip int)函数可以返回当前goroutine调用栈中的文件名,行号,函数信息等 参数skip表示表示返回的栈帧的层次,0表示runtime.Caller的调用者,依次往上推导 1表示调用者这一层,如果基于这个logger库封装的话,skip = 2 而runtime.Caller(2) 返回当前goroutine调用栈中的文件名,行号,函数信息
func LogSugar ¶
func LogSugar() *zap.SugaredLogger
LogSugar sugar语法糖,支持简单的msg信息打印 支持Debug,Info,Error,Panic,Warn,Fatal等方法
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.