Documentation
¶
Index ¶
- Variables
- func InitLogger(cfg *LogConfig) error
- type FileLogConfig
- type Llog
- func (L *Llog) ErrorPrint(i ...interface{})
- func (L *Llog) ErrorPrintf(format string, i ...interface{})
- func (L *Llog) ErrorPrintfln(format string, i ...interface{})
- func (L *Llog) ErrorPrintln(i ...interface{})
- func (L *Llog) InfoPrint(i ...interface{})
- func (L *Llog) InfoPrintf(format string, i ...interface{})
- func (L *Llog) InfoPrintfln(format string, i ...interface{})
- func (L *Llog) InfoPrintln(i ...interface{})
- func (L *Llog) Print(i ...interface{})
- func (L *Llog) Printf(format string, i ...interface{})
- func (L *Llog) Printfln(format string, i ...interface{})
- func (L *Llog) Println(i ...interface{})
- func (L *Llog) SuccessPrint(i ...interface{})
- func (L *Llog) SuccessPrintf(format string, i ...interface{})
- func (L *Llog) SuccessPrintfln(format string, i ...interface{})
- func (L *Llog) SuccessPrintln(i ...interface{})
- func (L *Llog) WarnPrint(i ...interface{})
- func (L *Llog) WarnPrintf(format string, i ...interface{})
- func (L *Llog) WarnPrintfln(format string, i ...interface{})
- func (L *Llog) WarnPrintln(i ...interface{})
- type LogConfig
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var SlowQueryLogger = log.StandardLogger()
SlowQueryLogger is used to log slow query, InitLogger will modify it according to config file.
Functions ¶
Types ¶
type FileLogConfig ¶
type FileLogConfig struct {
// Log filename, leave empty to disable file log.
Filename string `toml:"filename" json:"filename"`
// Is log rotate enabled.
LogRotate bool `toml:"log-rotate" json:"log-rotate"`
// Max size for a single file, in MB.
MaxSize int `toml:"max-size" json:"max-size"`
// Max log keep days, default is never deleting.
MaxDays int `toml:"max-days" json:"max-days"`
// Maximum number of old log files to retain.
MaxBackups int `toml:"max-backups" json:"max-backups"`
}
FileLogConfig serializes file log related config in toml/json.
type Llog ¶
type Llog struct {
// contains filtered or unexported fields
}
func (*Llog) ErrorPrint ¶
func (L *Llog) ErrorPrint(i ...interface{})
*************** Error Print Start *****************
func (*Llog) ErrorPrintf ¶
func (*Llog) ErrorPrintfln ¶
func (*Llog) ErrorPrintln ¶
func (L *Llog) ErrorPrintln(i ...interface{})
func (*Llog) InfoPrint ¶
func (L *Llog) InfoPrint(i ...interface{})
*************** Info Print Start *****************
func (*Llog) InfoPrintf ¶
func (*Llog) InfoPrintfln ¶
func (*Llog) InfoPrintln ¶
func (L *Llog) InfoPrintln(i ...interface{})
func (*Llog) Print ¶
func (L *Llog) Print(i ...interface{})
*************** Simple Print Start *****************
func (*Llog) SuccessPrint ¶
func (L *Llog) SuccessPrint(i ...interface{})
*************** Success Print Start *****************
func (*Llog) SuccessPrintf ¶
func (*Llog) SuccessPrintfln ¶
func (*Llog) SuccessPrintln ¶
func (L *Llog) SuccessPrintln(i ...interface{})
func (*Llog) WarnPrint ¶
func (L *Llog) WarnPrint(i ...interface{})
*************** Warn Print Start *****************
func (*Llog) WarnPrintf ¶
func (*Llog) WarnPrintfln ¶
func (*Llog) WarnPrintln ¶
func (L *Llog) WarnPrintln(i ...interface{})
type LogConfig ¶
type LogConfig struct {
// Log level.
Level string `toml:"level" json:"level"`
// Log format. one of json, text, or console.
Format string `toml:"format" json:"format"`
// Disable automatic timestamps in output.
DisableTimestamp bool `toml:"disable-timestamp" json:"disable-timestamp"`
// File log config.
File FileLogConfig `toml:"file" json:"file"`
// SlowQueryFile filename, default to File log config on empty.
SlowQueryFile string
}
LogConfig serializes log related config in toml/json.
Click to show internal directories.
Click to hide internal directories.






