Documentation ¶
Index ¶
- func Debug(a ...interface{})
- func Debugf(format string, a ...interface{})
- func Error(a ...interface{})
- func Errorf(format string, a ...interface{})
- func Fatal(a ...interface{})
- func Fatalf(format string, a ...interface{})
- func Info(a ...interface{})
- func Infof(format string, a ...interface{})
- func NewWriter(opts WriterOptions) (io.Writer, error)
- func Panic(a ...interface{})
- func Panicf(format string, a ...interface{})
- func SetLogger(logger Logger)
- func Warn(a ...interface{})
- func Warnf(format string, a ...interface{})
- type CutRule
- type DefaultLogger
- func (l *DefaultLogger) Debug(a ...interface{})
- func (l *DefaultLogger) Debugf(format string, a ...interface{})
- func (l *DefaultLogger) Entity(level Level, a ...interface{}) *Entity
- func (l *DefaultLogger) Error(a ...interface{})
- func (l *DefaultLogger) Errorf(format string, a ...interface{})
- func (l *DefaultLogger) Fatal(a ...interface{})
- func (l *DefaultLogger) Fatalf(format string, a ...interface{})
- func (l *DefaultLogger) Info(a ...interface{})
- func (l *DefaultLogger) Infof(format string, a ...interface{})
- func (l *DefaultLogger) Panic(a ...interface{})
- func (l *DefaultLogger) Panicf(format string, a ...interface{})
- func (l *DefaultLogger) Warn(a ...interface{})
- func (l *DefaultLogger) Warnf(format string, a ...interface{})
- type Entity
- type EntityPool
- type Format
- type Level
- type Logger
- type Option
- func WithCallerFullPath(enable bool) Option
- func WithCallerSkip(skip int) Option
- func WithClassifiedStorage(enable bool) Option
- func WithFile(file string) Option
- func WithFileCutRule(cutRule CutRule) Option
- func WithFileMaxAge(maxAge time.Duration) Option
- func WithFileMaxSize(size int64) Option
- func WithFormat(format Format) Option
- func WithLevel(level Level) Option
- func WithStackLevel(level Level) Option
- func WithStdout(enable bool) Option
- func WithTimeFormat(format string) Option
- type WriterOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
func NewLogger ¶
func NewLogger(opts ...Option) *DefaultLogger
func (*DefaultLogger) Debugf ¶
func (l *DefaultLogger) Debugf(format string, a ...interface{})
Debugf 打印调试模板日志
func (*DefaultLogger) Entity ¶
func (l *DefaultLogger) Entity(level Level, a ...interface{}) *Entity
Entity 构建日志实体
func (*DefaultLogger) Errorf ¶
func (l *DefaultLogger) Errorf(format string, a ...interface{})
Errorf 打印错误模板日志
func (*DefaultLogger) Fatalf ¶
func (l *DefaultLogger) Fatalf(format string, a ...interface{})
Fatalf 打印致命错误模板日志
func (*DefaultLogger) Infof ¶
func (l *DefaultLogger) Infof(format string, a ...interface{})
Infof 打印信息模板日志
func (*DefaultLogger) Panicf ¶
func (l *DefaultLogger) Panicf(format string, a ...interface{})
Panicf 打印Panic模板日志
func (*DefaultLogger) Warnf ¶
func (l *DefaultLogger) Warnf(format string, a ...interface{})
Warnf 打印警告模板日志
type Entity ¶
type EntityPool ¶
type EntityPool struct {
// contains filtered or unexported fields
}
type Logger ¶
type Logger interface { // Debug 打印调试日志 Debug(a ...interface{}) // Debugf 打印调试模板日志 Debugf(format string, a ...interface{}) // Info 打印信息日志 Info(a ...interface{}) // Infof 打印信息模板日志 Infof(format string, a ...interface{}) // Warn 打印警告日志 Warn(a ...interface{}) // Warnf 打印警告模板日志 Warnf(format string, a ...interface{}) // Error 打印错误日志 Error(a ...interface{}) // Errorf 打印错误模板日志 Errorf(format string, a ...interface{}) // Fatal 打印致命错误日志 Fatal(a ...interface{}) // Fatalf 打印致命错误模板日志 Fatalf(format string, a ...interface{}) // Panic 打印Panic日志 Panic(a ...interface{}) // Panicf 打印Panic模板日志 Panicf(format string, a ...interface{}) }
type Option ¶
type Option func(o *options)
func WithCallerFullPath ¶
WithCallerFullPath 设置是否启用调用文件全路径
func WithClassifiedStorage ¶
WithClassifiedStorage 设置启用文件分级存储 启用后,日志将进行分级存储,大一级的日志将存储于小于等于自身的日志级别文件中 例如:InfoLevel级的日志将存储于due.debug.20220910.log、due.info.20220910.log两个日志文件中
Click to show internal directories.
Click to hide internal directories.