Documentation ¶
Index ¶
- Constants
- func Debug(format string, v ...interface{})
- func Error(format string, v ...interface{})
- func Fatal(format string, v ...interface{})
- func Info(format string, v ...interface{})
- func InitFileLog(dir, module, level string)
- func IsEnableDebug() bool
- func IsEnableError() bool
- func IsEnableInfo() bool
- func IsEnableTrace() bool
- func IsEnableWarn() bool
- func Panic(format string, v ...interface{})
- func SetLevel(level string)
- func Warn(format string, v ...interface{})
- type Log
- func (l *Log) Debug(format string, v ...interface{})
- func (l *Log) Error(format string, v ...interface{})
- func (l *Log) Fatal(format string, v ...interface{})
- func (l *Log) Info(format string, v ...interface{})
- func (l *Log) IsEnableDebug() bool
- func (l *Log) IsEnableError() bool
- func (l *Log) IsEnableInfo() bool
- func (l *Log) IsEnableTrace() bool
- func (l *Log) IsEnableWarn() bool
- func (l *Log) Output(calldepth int, s string, sync bool)
- func (l *Log) Panic(format string, v ...interface{})
- func (l *Log) SetLevel(level string)
- func (l *Log) SetPrefix(s, level string) string
- func (l *Log) Warn(format string, v ...interface{})
Constants ¶
View Source
const ( // A colon appears after these items: 2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message Ldate = 1 << iota // the date: 2009/01/23 Ltime // the time: 01:23:23 Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime. Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile // final file name element and line number: d.go:23. overrides Llongfile LstdFlags = Ldate | Ltime // initial values for the standard logger LogFileNameDateFormat = "2006-01-02" )
View Source
const ( TraceLevel = 0 DebugLevel = 1 InfoLevel = 2 WarnLevel = 3 ErrorLevel = 4 FatalLevel = 5 )
Variables ¶
This section is empty.
Functions ¶
func InitFileLog ¶
func InitFileLog(dir, module, level string)
func IsEnableDebug ¶
func IsEnableDebug() bool
func IsEnableError ¶
func IsEnableError() bool
func IsEnableInfo ¶
func IsEnableInfo() bool
func IsEnableTrace ¶
func IsEnableTrace() bool
func IsEnableWarn ¶
func IsEnableWarn() bool
Types ¶
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
func GetFileLogger ¶
func GetFileLogger() *Log
func NewDefaultLog ¶
func NewDefaultLog() *Log
func (*Log) IsEnableDebug ¶
func (*Log) IsEnableError ¶
func (*Log) IsEnableInfo ¶
func (*Log) IsEnableTrace ¶
func (*Log) IsEnableWarn ¶
Click to show internal directories.
Click to hide internal directories.