Documentation ¶
Index ¶
- Constants
- Variables
- type Buffer
- type BufferPool
- type Config
- type Format
- type FormatConfig
- type Logger
- func (lg *Logger) Append(message []byte) (n int, err error)
- func (lg *Logger) Close() error
- func (lg *Logger) Debug(format string, args ...interface{})
- func (lg *Logger) Error(format string, args ...interface{})
- func (lg *Logger) Fatal(format string, args ...interface{})
- func (lg *Logger) Info(format string, args ...interface{})
- func (lg *Logger) Output(calldepth int, s string) (n int, err error)
- func (lg *Logger) SetLevel(level int)
- func (lg *Logger) Stack(err error) string
- func (lg *Logger) String(calldpeth int, level, message string) []byte
- func (lg *Logger) Warn(format string, args ...interface{})
- type Write
- type WriteConfig
Constants ¶
View Source
const ( DebugLevel int = iota InfoLevel WarnLevel ErrorLevel FatalLevel )
Variables ¶
View Source
var Zap *zap.Logger
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
func (*Buffer) AppendString ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
func NewBufferPool ¶
func NewBufferPool() BufferPool
func (BufferPool) Get ¶
func (bp BufferPool) Get() *Buffer
func (BufferPool) Put ¶
func (bp BufferPool) Put(buf *Buffer)
type Config ¶
type Config struct { // 调用深度 Calldpeth int // 日志等级,>= 设置的等级才会写入 Level int // 格式化,配置 Format *FormatConfig Write *WriteConfig }
Config 日志配置信息
type Format ¶
type Format struct {
// contains filtered or unexported fields
}
func (*Format) GenMessage ¶
GenMessage 生成等待写入的内容
type FormatConfig ¶
FormatConfig
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
保留日志天数,定时扫描 dir
type WriteConfig ¶
type WriteConfig struct { // 写入文件 Filename string // 单文件最大 bytes MaxSize int64 // 保留文件时间 MaxAge time.Duration // Gzip 压缩 Compress bool }
func DefaultWriteConfig ¶
func DefaultWriteConfig() *WriteConfig
Click to show internal directories.
Click to hide internal directories.