fix# Change the Log level and add WarnLevel (#935)
* fix# Change the Log level and add WarnLevel * fix# Change the Log level and add WarnLevel
This commit is contained in:
parent
5ae3e179b9
commit
5ffe367cae
@ -14,8 +14,9 @@ type Level int
|
||||
|
||||
const (
|
||||
LevelFatal Level = iota
|
||||
LevelInfo
|
||||
LevelError
|
||||
LevelInfo
|
||||
LevelWarn
|
||||
LevelDebug
|
||||
LevelTrace
|
||||
)
|
||||
@ -37,6 +38,8 @@ func init() {
|
||||
level = LevelTrace
|
||||
case "debug":
|
||||
level = LevelDebug
|
||||
case "warn":
|
||||
level = LevelWarn
|
||||
case "info":
|
||||
level = LevelInfo
|
||||
case "error":
|
||||
@ -99,6 +102,16 @@ func Debugf(format string, v ...interface{}) {
|
||||
WithLevelf(LevelDebug, format, v...)
|
||||
}
|
||||
|
||||
// Warn provides warn level logging
|
||||
func Warn(v ...interface{}) {
|
||||
WithLevel(LevelWarn, v...)
|
||||
}
|
||||
|
||||
// Warnf provides warn level logging
|
||||
func Warnf(format string, v ...interface{}) {
|
||||
WithLevelf(LevelWarn, format, v...)
|
||||
}
|
||||
|
||||
// Info provides info level logging
|
||||
func Info(v ...interface{}) {
|
||||
WithLevel(LevelInfo, v...)
|
||||
|
Loading…
x
Reference in New Issue
Block a user