Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Level ¶
type Level int8
const ( // TraceLevel 指定比 debug 更小粒度的日志信息 TraceLevel Level = iota // DebugLevel debug 调试信息, 内容相对更详细 DebugLevel // InfoLevel 默认的日志级别, 通常输出程序正常执行期间的日志 InfoLevel // WarnLevel 警告级别 通常输出值得关注的条目 WarnLevel // ErrorLevel 错误级别 通常是非常值得关注的错误信息 ErrorLevel // FatalLevel 该级别的日志会记录并调用 log.Exit(1), 为最高级别的错误 FatalLevel )
type Logger ¶
type Logger interface {
Init(...Option) error
Options() *Options
// WithFields 添加输出固定字段
WithFields(map[string]interface{})
// Hook 添加钩子到日志
Hook(Hook)
// NewKidHook 创建一个自定义的 Hook 的封装
NewKidHook(Worker) Hook
// Log 输出日志
Log(Level, ...interface{})
// Logf 输出带格式化的日志
Logf(Level, string, ...interface{})
}
Click to show internal directories.
Click to hide internal directories.