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 NewLogger(opts ...Option) *defaultLogger
- 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 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 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两个日志文件中
Source Files ¶
Click to show internal directories.
Click to hide internal directories.