Documentation
¶
Index ¶
- func Author() string
- func License() string
- func Version() string
- type LogFile
- type LogLevel
- type Logger
- func (l *Logger) Close()
- func (l *Logger) Debug(msg string, args ...interface{})
- func (l *Logger) DebugOnce(msg string, args ...interface{})
- func (l *Logger) Error(msg string, args ...interface{})
- func (l *Logger) ErrorOnce(msg string, args ...interface{})
- func (l *Logger) Fatal(msg string, args ...interface{})
- func (l *Logger) FatalOnce(msg string, args ...interface{})
- func (l *Logger) GetLevelByString(level string) LogLevel
- func (l *Logger) Info(msg string, args ...interface{})
- func (l *Logger) InfoOnce(msg string, args ...interface{})
- func (l *Logger) Log(level string, msg string, args ...interface{})
- func (l *Logger) LogOnce(level string, msg string, args ...interface{})
- func (l *Logger) SetDailyRotate(rotateNum int64) error
- func (l *Logger) SetLevel(level LogLevel)
- func (l *Logger) SetLevelString(level string) error
- func (l *Logger) SetRotate(rotateType string, rotateNum int64, rotateSize int64) error
- func (l *Logger) SetSizeRotate(rotateNum int64, rotateSize int64) error
- func (l *Logger) Warn(msg string, args ...interface{})
- func (l *Logger) WarnOnce(msg string, args ...interface{})
- type OnceCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogFile ¶
type LogFile struct {
Name string
Fd *os.File
Writer io.Writer
RotateType string
RotateNum int64
RotateSize int64
RotateNowDate string
RotateNowSize int64
RotateNextNum int64
}
LogFile storing log file
type Logger ¶
type Logger struct {
LogFile LogFile
LogLevel LogLevel
LogQueue chan string
LogExit chan bool
Closed bool
}
Logger storing logger
func (*Logger) GetLevelByString ¶
GetLevelByString returns log level by string level
func (*Logger) SetDailyRotate ¶
SetDailyRotate set daily log rotate
func (*Logger) SetLevelString ¶
SetLevelString set the log level by string level
func (*Logger) SetRotate ¶
SetRotate set log rotate rotateType: date: daily rotate, size: filesize rotate
func (*Logger) SetSizeRotate ¶
SetSizeRotate set filesize log rotate
Click to show internal directories.
Click to hide internal directories.