Documentation ¶
Index ¶
- Constants
- func Critical(i ...interface{})
- func Criticalf(format string, i ...interface{})
- func Debug(i ...interface{})
- func DebugDontPanic(i interface{})
- func DebugDontPanicf(format string, i ...interface{})
- func Debugf(format string, i ...interface{})
- func DontPanic(i interface{})
- func DontPanicf(format string, i ...interface{})
- func Error(i ...interface{})
- func Errorf(format string, i ...interface{})
- func Info(i ...interface{})
- func Infof(format string, i ...interface{})
- func InitLogger(logLevel int)
- func LogError(err error)
- func LogErrorAndExit(err error, opts ...int)
- func Panic(i interface{})
- func RestoreLogLevel()
- func SetLogLevel(logLevel int)
- func SetLogfile(logfilePath string, opts ...os.FileMode)
- func Warn(i ...interface{})
- func Warnf(format string, i ...interface{})
Constants ¶
View Source
const ( // LDebug log level LDebug = 1 // LInfo log level LInfo = 1 << 1 // LError log level LError = 1 << 2 // LCritical log level LCritical = 1 << 3 )
Variables ¶
This section is empty.
Functions ¶
func Criticalf ¶
func Criticalf(format string, i ...interface{})
Criticalf log message with format if gLogLevel <= LCritical
func DebugDontPanic ¶
func DebugDontPanic(i interface{})
DebugDontPanic only prints panic information but don't panic
func DebugDontPanicf ¶
func DebugDontPanicf(format string, i ...interface{})
DebugDontPanicf only prints panic information but don't panic
func Debugf ¶
func Debugf(format string, i ...interface{})
Debugf log message with format if gLogLevel <= LDebug
func DontPanic ¶
func DontPanic(i interface{})
DontPanic only prints panic information but don't panic
func DontPanicf ¶
func DontPanicf(format string, i ...interface{})
DontPanicf only prints panic information but don't panic
func Errorf ¶
func Errorf(format string, i ...interface{})
Errorf log message with format if gLogLevel <= LError
func Infof ¶
func Infof(format string, i ...interface{})
Infof log message with format if gLogLevel <= LInfo
func LogErrorAndExit ¶
LogErrorAndExit logs an error and exit with an optional return code
func SetLogLevel ¶
func SetLogLevel(logLevel int)
SetLogLevel backup gLoglevel and set gLogLevel to logLevel
func SetLogfile ¶
SetLogfile sets output file to put logging messages
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.