Documentation ¶
Index ¶
- Constants
- func CrashLog(file string)
- func Debug(v ...interface{})
- func DebugEnabled() bool
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func ErrorEnabled() bool
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func FatalEnabled() bool
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func InfoEnabled() bool
- func Infof(format string, v ...interface{})
- func InitLog()
- func SetFlags(flags int)
- func SetHighlighting(highlighting bool)
- func SetLevel(level Level)
- func SetLevelByString(level string)
- func SetLogCount(value int)
- func SetOutput(out io.Writer)
- func SetOutputByName(path string) error
- func SetRotateByDay()
- func SetRotateByHour()
- func WarnEnabled() bool
- func Warning(v ...interface{})
- func Warningf(format string, v ...interface{})
- type Cfg
- type Level
- type Logger
- type Type
Constants ¶
View Source
const ( // Ldate flags Ldate = log.Ldate // Llongfile flags Llongfile = log.Llongfile // Lmicroseconds flags Lmicroseconds = log.Lmicroseconds // Lshortfile flags Lshortfile = log.Lshortfile // LstdFlags flags LstdFlags = log.LstdFlags // Ltime flags Ltime = log.Ltime )
View Source
const ( // LogNone log nothing LogNone = Level(0x0) // LogFatal log fatal LogFatal = LogNone | Level(fatalLevel) // LogError log error & fatal LogError = LogFatal | Level(errorLevel) // LogWarn log warn & error & fatal LogWarn = LogError | Level(warnLevel) // LogInfo log info & warn & error & fatal LogInfo = LogWarn | Level(infoLevel) // LogDebug log debug & info & warn & error & fatal LogDebug = LogInfo | Level(debugLevel) // LogAll log all LogAll = LogDebug )
Variables ¶
This section is empty.
Functions ¶
func SetLevelByString ¶
func SetLevelByString(level string)
SetLevelByString set log by string level
func SetOutputByName ¶
SetOutputByName set log file use file name
Types ¶
type Logger ¶
type Logger interface { FatalEnabled() bool ErrorEnabled() bool WarnEnabled() bool InfoEnabled() bool DebugEnabled() bool Info(v ...interface{}) Infof(format string, v ...interface{}) Debug(v ...interface{}) Debugf(format string, v ...interface{}) Warning(v ...interface{}) Warningf(format string, v ...interface{}) Error(v ...interface{}) Errorf(format string, v ...interface{}) Fatal(v ...interface{}) Fatalf(format string, v ...interface{}) }
Logger logger interface
func NewLoggerWithPrefix ¶
NewLoggerWithPrefix returns a logger with prefix
Click to show internal directories.
Click to hide internal directories.