Documentation
¶
Index ¶
- func Exit()
- func InitLogger(c Config)
- type Config
- type ModConfig
- func SetAppName(AppName string) ModConfig
- func SetDebugFileName(DebugFileName string) ModConfig
- func SetDevelopment(Development bool) ModConfig
- func SetErrorFileName(ErrorFileName string) ModConfig
- func SetInfoFileName(InfoFileName string) ModConfig
- func SetLevel(Level zapcore.Level) ModConfig
- func SetLogFileDir(LogFileDir string) ModConfig
- func SetMaxAge(MaxAge int) ModConfig
- func SetMaxBackups(MaxBackups int) ModConfig
- func SetMaxSize(MaxSize int) ModConfig
- func SetWarnFileName(WarnFileName string) ModConfig
- type ZapConfig
- type ZapLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
func InitLogger(c Config)
InitLogger 设置日志级别 debug 可以打印出 info debug warn info 级别可以打印 warn info warn 只能打印 warn debug->info->warn->error
Types ¶
type ModConfig ¶
type ModConfig func(*ZapConfig)
func SetAppName ¶
func SetDebugFileName ¶
func SetDevelopment ¶
func SetErrorFileName ¶
func SetInfoFileName ¶
func SetLogFileDir ¶
func SetMaxBackups ¶
func SetMaxSize ¶
func SetWarnFileName ¶
type ZapConfig ¶
type ZapConfig struct {
AppName string // 日志文件前缀
LogFileDir string // 文件保存地方
ErrorFileName string
WarnFileName string
InfoFileName string
DebugFileName string
Level zapcore.Level // 日志等级
MaxSize int // 日志文件小大(M)
MaxBackups int // 最多存在多少个切片文件
MaxAge int // 保存的最大天数
Development bool // 是否是开发模式
zap.Config
}
Click to show internal directories.
Click to hide internal directories.