Documentation
¶
Overview ¶
*
- 每天流动式日志实现
- 操作日志记录到文件,支持info,error,debug,notice,alert等
- 写日志文件的时候,采用乐观锁方式对文件句柄进行加锁
- 等级参考php Monolog/logger.php
- 日志切割机制参考lumberjack包实现
- json encode采用jsoniter库快速json encode处理
Index ¶
- Constants
- Variables
- func AlterLog(v interface{}, options map[string]interface{})
- func CritLog(v interface{}, options map[string]interface{})
- func DebugLog(v interface{}, options map[string]interface{})
- func EmergLog(v interface{}, options map[string]interface{})
- func ErrorLog(v interface{}, options map[string]interface{})
- func InfoLog(v interface{}, options map[string]interface{})
- func LogSize(n int64)
- func LogSplit(b bool)
- func NoticeLog(v interface{}, options map[string]interface{})
- func RecoverLog()
- func SetLogDir(dir string)
- func SetLogTimeZone(timezone string)
- func WarnLog(v interface{}, options map[string]interface{})
Constants ¶
View Source
const ( EMERGENCY = "emerg" // 严重错误: 导致系统崩溃无法使用 ALTER = "alter" // 警戒性错误: 必须被立即修改的错误 CRIT = "crit" // 临界值错误: 超过临界值的错误,例如一天24小时,而输入的是25小时这样 ERR = "error" // 一般错误:比如类型错误,数据库连接不上等等 WARN = "warn" // 警告性错误: 需要发出警告的错误 NOTICE = "notice" // 通知: 程序可以运行但是还不够完美的错误 INFO = "info" // 信息: 程序输出信息 DEBUG = "debug" // 调试: 调试信息 )
日志级别 从上到下,由高到低
Variables ¶
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.