Add log level helper funtions (#1229)
This commit is contained in:
@@ -68,3 +68,51 @@ func GetLevel(levelStr string) (Level, error) {
|
||||
}
|
||||
return InfoLevel, fmt.Errorf("Unknown Level String: '%s', defaulting to NoLevel", levelStr)
|
||||
}
|
||||
|
||||
func Info(args ...interface{}) {
|
||||
DefaultLogger.Log(InfoLevel, args...)
|
||||
}
|
||||
|
||||
func Infof(template string, args ...interface{}) {
|
||||
DefaultLogger.Logf(InfoLevel, template, args...)
|
||||
}
|
||||
|
||||
func Trace(args ...interface{}) {
|
||||
DefaultLogger.Log(TraceLevel, args...)
|
||||
}
|
||||
|
||||
func Tracef(template string, args ...interface{}) {
|
||||
DefaultLogger.Logf(TraceLevel, template, args...)
|
||||
}
|
||||
|
||||
func Debug(args ...interface{}) {
|
||||
DefaultLogger.Log(DebugLevel, args...)
|
||||
}
|
||||
|
||||
func Debugf(template string, args ...interface{}) {
|
||||
DefaultLogger.Logf(DebugLevel, template, args...)
|
||||
}
|
||||
|
||||
func Warn(args ...interface{}) {
|
||||
DefaultLogger.Log(WarnLevel, args...)
|
||||
}
|
||||
|
||||
func Warnf(template string, args ...interface{}) {
|
||||
DefaultLogger.Logf(WarnLevel, template, args...)
|
||||
}
|
||||
|
||||
func Error(args ...interface{}) {
|
||||
DefaultLogger.Log(ErrorLevel, args...)
|
||||
}
|
||||
|
||||
func Errorf(template string, args ...interface{}) {
|
||||
DefaultLogger.Logf(ErrorLevel, template, args...)
|
||||
}
|
||||
|
||||
func Fatal(args ...interface{}) {
|
||||
DefaultLogger.Log(FatalLevel, args...)
|
||||
}
|
||||
|
||||
func Fatalf(template string, args ...interface{}) {
|
||||
DefaultLogger.Logf(FatalLevel, template, args...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user