1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00

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:
Huang.X 2019-11-11 15:57:14 +08:00 committed by Asim Aslam
parent 5ae3e179b9
commit 5ffe367cae

View File

@ -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...)