Documentation ¶
Index ¶
- Constants
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Debugw(msg string, keysAndValues ...interface{})
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Errorw(msg string, keysAndValues ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Fatalw(msg string, keysAndValues ...interface{})
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func Infow(msg string, keysAndValues ...interface{})
- func Init(path, level string, options ...Option)
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Panicw(msg string, keysAndValues ...interface{})
- func Sync()
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- func Warnw(msg string, keysAndValues ...interface{})
- type Log
- func (l *Log) Build()
- func (l *Log) DPanic(args ...interface{})
- func (l *Log) DPanicf(template string, args ...interface{})
- func (l *Log) DPanicw(msg string, keysAndValues ...interface{})
- func (l *Log) Debug(args ...interface{})
- func (l *Log) Debugf(template string, args ...interface{})
- func (l *Log) Debugw(msg string, keysAndValues ...interface{})
- func (l *Log) Error(args ...interface{})
- func (l *Log) Errorf(template string, args ...interface{})
- func (l *Log) Errorw(msg string, keysAndValues ...interface{})
- func (l *Log) Fatal(args ...interface{})
- func (l *Log) Fatalf(template string, args ...interface{})
- func (l *Log) Fatalw(msg string, keysAndValues ...interface{})
- func (l *Log) Info(args ...interface{})
- func (l *Log) Infof(template string, args ...interface{})
- func (l *Log) Infow(msg string, keysAndValues ...interface{})
- func (l *Log) Panic(args ...interface{})
- func (l *Log) Panicf(template string, args ...interface{})
- func (l *Log) Panicw(msg string, keysAndValues ...interface{})
- func (l *Log) Warn(args ...interface{})
- func (l *Log) Warnf(template string, args ...interface{})
- func (l *Log) Warnw(msg string, keysAndValues ...interface{})
- type Option
Constants ¶
View Source
const ( DebugLevel = "debug" InfoLevel = "info" WarnLevel = "warn" ErrorLevel = "error" PanicLevel = "panic" )
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf 使用方法:log.Debugf("test:%s", err)
Types ¶
type Log ¶
type Log struct { Path string // 文件路径,如:./app.log Level string // 日志输出的级别 MaxFileSize int // 日志文件大小的最大值,单位(M) MaxBackups int // 最多保留备份数 MaxAge int // 日志文件保存的时间,单位(天) Compress bool // 是否压缩 Caller bool // 日志是否需要显示调用位置 Stdout bool // 是否输出到控制台 // contains filtered or unexported fields }
func NewZapAdapter ¶
type Option ¶
type Option func(log *Log)
func SetCompress ¶
func SetMaxBackups ¶
func SetMaxFileSize ¶
Click to show internal directories.
Click to hide internal directories.