switch warn to error logging
This commit is contained in:
parent
690640eeeb
commit
e1d56fbf58
@ -14,7 +14,7 @@ type Level int
|
|||||||
const (
|
const (
|
||||||
LevelFatal Level = iota
|
LevelFatal Level = iota
|
||||||
LevelInfo
|
LevelInfo
|
||||||
LevelWarn
|
LevelError
|
||||||
LevelDebug
|
LevelDebug
|
||||||
LevelTrace
|
LevelTrace
|
||||||
)
|
)
|
||||||
@ -29,16 +29,16 @@ var (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
switch os.Getenv("MICRO_LOG_LEVEL") {
|
switch os.Getenv("MICRO_LOG_LEVEL") {
|
||||||
|
case "trace":
|
||||||
|
level = LevelTrace
|
||||||
case "debug":
|
case "debug":
|
||||||
level = LevelDebug
|
level = LevelDebug
|
||||||
case "info":
|
case "info":
|
||||||
level = LevelInfo
|
level = LevelInfo
|
||||||
case "trace":
|
case "error":
|
||||||
level = LevelTrace
|
level = LevelError
|
||||||
case "fatal":
|
case "fatal":
|
||||||
level = LevelFatal
|
level = LevelFatal
|
||||||
case "warn":
|
|
||||||
level = LevelWarn
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,14 +98,14 @@ func Infof(format string, v ...interface{}) {
|
|||||||
WithLevelf(LevelInfo, format, v...)
|
WithLevelf(LevelInfo, format, v...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Warn provides warn level logging
|
// Error provides warn level logging
|
||||||
func Warn(v ...interface{}) {
|
func Error(v ...interface{}) {
|
||||||
WithLevel(LevelWarn, v...)
|
WithLevel(LevelError, v...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Warnf provides warn level logging
|
// Errorf provides warn level logging
|
||||||
func Warnf(format string, v ...interface{}) {
|
func Errorf(format string, v ...interface{}) {
|
||||||
WithLevelf(LevelWarn, format, v...)
|
WithLevelf(LevelError, format, v...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fatal logs with Log and then exits with os.Exit(1)
|
// Fatal logs with Log and then exits with os.Exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user