2020-02-07 00:35:46 +03:00
|
|
|
package logger
|
|
|
|
|
|
|
|
type Level int8
|
|
|
|
|
|
|
|
const (
|
|
|
|
TraceLevel Level = iota - 1
|
|
|
|
DebugLevel
|
|
|
|
InfoLevel
|
|
|
|
WarnLevel
|
|
|
|
ErrorLevel
|
|
|
|
PanicLevel
|
|
|
|
FatalLevel
|
|
|
|
)
|
2020-02-15 21:19:28 +03:00
|
|
|
|
|
|
|
func (l Level) String() string {
|
|
|
|
switch l {
|
|
|
|
case TraceLevel:
|
|
|
|
return "trace"
|
|
|
|
case DebugLevel:
|
|
|
|
return "debug"
|
|
|
|
case InfoLevel:
|
|
|
|
return "info"
|
|
|
|
case WarnLevel:
|
|
|
|
return "warn"
|
|
|
|
case ErrorLevel:
|
|
|
|
return "error"
|
|
|
|
case FatalLevel:
|
|
|
|
return "fatal"
|
|
|
|
case PanicLevel:
|
|
|
|
return "panic"
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|