Versions in this module Expand all Collapse all v1 v1.0.50 Nov 27, 2020 Changes in this version + const ErrorLevel + const InfoLevel + const SevereLevel + var ErrLogFileClosed = errors.New("error: log file closed") + var ErrLogNotInitialized = errors.New("log not initialized") + var ErrLogPathNotSet = errors.New("log path must be set") + var ErrLogServiceNameNotSet = errors.New("log service name must be set") + func Alert(v string) + func Close() error + func CollectSysLog() + func Disable() + func Error(v ...interface{}) + func ErrorCaller(callDepth int, v ...interface{}) + func ErrorCallerf(callDepth int, format string, v ...interface{}) + func ErrorStack(v ...interface{}) + func ErrorStackf(format string, v ...interface{}) + func Errorf(format string, v ...interface{}) + func Info(v ...interface{}) + func Infof(format string, v ...interface{}) + func Must(err error) + func MustSetup(c LogConf) + func NewLessWriter(writer io.Writer, milliseconds int) *lessWriter + func SetLevel(level uint32) + func SetUp(c LogConf) error + func Severe(v ...interface{}) + func Severef(format string, v ...interface{}) + func Slow(v ...interface{}) + func Slowf(format string, v ...interface{}) + func Stat(v ...interface{}) + func Statf(format string, v ...interface{}) + type DailyRotateRule struct + func (r *DailyRotateRule) BackupFileName() string + func (r *DailyRotateRule) MarkRotated() + func (r *DailyRotateRule) OutdatedFiles() []string + func (r *DailyRotateRule) ShallRotate() bool + type LessLogger struct + func NewLessLogger(milliseconds int) *LessLogger + func (logger *LessLogger) Error(v ...interface{}) + func (logger *LessLogger) Errorf(format string, v ...interface{}) + type LogConf struct + Compress bool + KeepDays int + Level string + Mode string + Path string + ServiceName string + StackCooldownMillis int + type LogOption func(options *logOptions) + func WithCooldownMillis(millis int) LogOption + func WithGzip() LogOption + func WithKeepDays(days int) LogOption + type Logger interface + Error func(...interface{}) + Errorf func(string, ...interface{}) + Info func(...interface{}) + Infof func(string, ...interface{}) + Slow func(...interface{}) + Slowf func(string, ...interface{}) + WithDuration func(time.Duration) Logger + func WithContext(ctx context.Context) Logger + func WithDuration(d time.Duration) Logger + type RotateLogger struct + func NewLogger(filename string, rule RotateRule, compress bool) (*RotateLogger, error) + func (l *RotateLogger) Close() error + func (l *RotateLogger) Write(data []byte) (int, error) + type RotateRule interface + BackupFileName func() string + MarkRotated func() + OutdatedFiles func() []string + ShallRotate func() bool + func DefaultRotateRule(filename, delimiter string, days int, gzip bool) RotateRule