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 CutOption
- type Level
- type LogConfig
- type Logger
- type Option
- func WithAppName(name string) Option
- func WithBufferSize(size int) Option
- func WithCutOption(cutOption CutOption) Option
- func WithFlushDuration(duration time.Duration) Option
- func WithLogPath(filepath string) Option
- func WithMaxTime(sec int64) Option
- func WithStdout(b bool) Option
- func WithWriteLevel(level Level) Option
- func WithWriteOption(opt WriteOption) Option
- type WriteOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CutOption ¶
type CutOption int // CutOption 日志文件切割周期选项
const ( CutDaily CutOption // 根据时间周期,每天切割 CutHourly // 根据时间周期,每小时切割 CutHalfAnHour // 根据时间周期,每半小时切割 CutTenMin // 根据时间周期,每10分钟切割 CutPer10M // 根据文件大小,每10M切割一次 CutPer60M // 根据文件大小,每60M切割一次 CutPer100M // 根据文件大小,每100M切割一次 )
type Option ¶
type Option func(c *LogConfig)
func WithBufferSize ¶
WithBufferSize 设置日志通道buffer大小: [1024, 1024000]
func WithFlushDuration ¶
WithFlushDuration 多久刷盘一次, 单位毫秒: [500ms-5000ms]
func WithLogPath ¶
WithLogPath 设置日志文件存放目录(如果区分级别存放日志,将会在filepath下创建对应级别的目录用于区分)
func WithWriteLevel ¶
WithWriteLevel 日志记录级别: [ LevelFatal, LevelFatal | LevelError | LevelWarning | LevelInfo | LevelDebug ]
type WriteOption ¶
type WriteOption int // WriteOption 日志写选项
const ( WriteByLevel WriteOption // 区分级别, 不同级别记录在不同目录下相应的文件中 WriteByMerged // 不区分级别, 所有日志记录在一个文件中 WriteByAll // 既区分级别记录也一起记录 )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.