Documentation
¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- type FileOption
- type Level
- type LogConfig
- type Logger
- func (l *Logger) Close()
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(template string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(template string, args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(template string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(template string, args ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(template string, args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(template string, args ...interface{})
- type Option
- func WithFileOption(opt FileOption) Option
- func WithLogLevel(level Level) Option
- func WithLogPath(filepath string) Option
- func WithMaxAge(t time.Duration) Option
- func WithMaxSize(size int64) Option
- func WithName(name string) Option
- func WithStdout(b bool) Option
- func WithWriter(writer ...internal.LogWriter) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileOption ¶
type FileOption int // FileOption 日志文件写选项
const ( WriteByLevelSeparated FileOption // 区分级别, 不同级别记录在不同目录下相应的文件中 WriteByLevelMerged // 不区分级别, 所有日志记录在一个文件中 WriteByBoth // 既区分级别记录也一起记录 )
type Option ¶
type Option func(c *Logger)
func WithLogLevel ¶
WithLogLevel 日志记录级别: [ LevelFatal | LevelFatal | LevelError | LevelWarn | LevelInfo | LevelDebug ]
func WithLogPath ¶
WithLogPath 设置日志文件存放目录(如果区分级别存放日志,将会在filepath下创建对应级别的目录用于区分)
Click to show internal directories.
Click to hide internal directories.