Categorygithub.com/gtkit/logger
modulepackage
1.2.6
Repository: https://github.com/gtkit/logger.git
Documentation: pkg.go.dev

# README

logger

封装 zap 日志

推荐使用函数选项模式传入参数, 实例化日志

NewZap(
		WithConsole(true),
		WithDivision("size"),
		WithFile(true),
		WithSqlLog(false),
		WithPath("/home/www/logs"),
	)

# Functions

Blue ...
No description provided by the author
No description provided by the author
Debug 记录 debug 等级的日志.
Debugf 记录 debug 等级的日志.
DPanic 记录 dpanic 等级的日志.
DPanicf 记录 dpanic 等级的日志.
Error 记录 error 等级的日志.
Errorf 记录 error 等级的日志.
No description provided by the author
No description provided by the author
Fatal 级别同 Error(), 写完 log 后调用 os.Exit(1) 退出程序.
No description provided by the author
Green ...
Greenf ...
Info 记录 info 等级的日志.
Infof 记录 info 等级的日志.
No description provided by the author
No description provided by the author
LogIf 当 err != nil 时记录 error 等级的日志.
LogInfoIf 当 err != nil 时记录 info 等级的日志.
NewZap 函数选项模式实例化zap.
No description provided by the author
Panic 级别同 Error(), 写完 log 后调用 os.Exit(1) 退出程序.
RandomColor generates a random color.
Red ...
Redf ...
No description provided by the author
Sugar 获取 zap.SugaredLogger.
No description provided by the author
No description provided by the author
Warn 记录 warn 等级的日志.
Warnf 记录 warn 等级的日志.
No description provided by the author
WithConsole # 设置日志是否打印到控制台.
WithDivision # 设置日志切割模式,time:按时间切割, size:按大小切割.
WithFile # 设置日志是否输出到文件.
WithLevel # 设置日志输出级别.
WithMaxAge # 设置日志文件最大保存时间,单位:天.
WithMaxBackups # 设置日志文件最大保存数量.
No description provided by the author
WithPath # 设置日志输出路径.
Yellow ...
NewLog 获取 zap.Logger.
ZError Error.
Fatal 级别同 Error(), 写完 log 后调用 os.Exit(1) 退出程序.
ZInfo 记录 info 等级的日志.
Zlog 获取 zap.Logger.
ZWarn 记录 warn 等级的日志.

# Constants

No description provided by the author
默认压缩.
No description provided by the author
默认保存七天.
默认5个备份.
默认 512M.
默认保存目录.
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author