Documentation ¶
Index ¶
- Variables
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Fatalln(v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func InitLogger(conf *ZapConfig)
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func Panicln(v ...interface{})
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type ZapConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger *zap.Logger
View Source
var ZapLog *zap.SugaredLogger
Functions ¶
func Fatal ¶
func Fatal(v ...interface{})
Fatal is equivalent to Print() followed by a call to os.Exit(1).
func InitLogger ¶
func InitLogger(conf *ZapConfig)
Types ¶
type ZapConfig ¶
type ZapConfig struct { LogPath string // 日志文件路径 LogLevel string //日志级别 debug/info/warn/error MaxSize int //单个文件大小,MB MaxBackups int // 保存的文件个数 MaxAge int // 保存的天数, 没有的话不删除 Compress bool // 压缩 JsonFormat bool // 是否输出为json格式 ShowLine bool // 显示代码行 LogInConsole bool // 是否同时输出到控制台 ServerName string // 服务名称 }
func DefaultConfig ¶
func DefaultConfig() *ZapConfig
Click to show internal directories.
Click to hide internal directories.