Documentation
¶
Overview ¶
from gozero logx.rotatelogger.go
Index ¶
- Constants
- Variables
- func CloseLogFiles()
- func ReopenLogFiles()
- type DailyRotateRule
- type LogConf
- type LogCtx
- type LogFile
- type Logger
- func (l *Logger) LogDebug(c *LogCtx, format string, args ...interface{})
- func (l *Logger) LogError(c *LogCtx, format string, args ...interface{})
- func (l *Logger) LogInfo(c *LogCtx, format string, args ...interface{})
- func (l *Logger) LogSevere(c *LogCtx, format string, args ...interface{})
- func (l *Logger) Printf(format string, args ...interface{})
- type RotateRule
Constants ¶
View Source
const ( LOGDEBUG int = iota LOGINFO LOGERROR LOGSEVERE )
log level const definition
View Source
const (
LogBufsize = 4096
)
Variables ¶
View Source
var ( Level = map[string]int{ "debug": LOGDEBUG, "info": LOGINFO, "error": LOGERROR, "severe": LOGSEVERE, } LogDebug func(*LogCtx, string, ...interface{}) LogInfo func(*LogCtx, string, ...interface{}) LogError func(*LogCtx, string, ...interface{}) LogSevere func(*LogCtx, string, ...interface{}) )
Functions ¶
Types ¶
type DailyRotateRule ¶
type DailyRotateRule struct {
// contains filtered or unexported fields
}
func (*DailyRotateRule) BackupFileName ¶
func (r *DailyRotateRule) BackupFileName() string
func (*DailyRotateRule) MarkRotated ¶
func (r *DailyRotateRule) MarkRotated()
func (*DailyRotateRule) OutdatedFiles ¶
func (r *DailyRotateRule) OutdatedFiles() []string
func (*DailyRotateRule) ShallRotate ¶
func (r *DailyRotateRule) ShallRotate(_ int64) bool
type LogCtx ¶
type LogCtx struct { // Log Prefix Prefix func() string // Log Suffix Suffix func() string // Log Level LogLevel int }
LogCtx for user defined prefix and suffix add in log
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
type RotateRule ¶
type RotateRule interface { BackupFileName() string MarkRotated() OutdatedFiles() []string ShallRotate(size int64) bool }
func CreateDailyRotateRule ¶
func CreateDailyRotateRule(filename string, days int) RotateRule
Click to show internal directories.
Click to hide internal directories.