fc5339a368
* support unix daemon socket * refactor(logger): logger fields changed to map[string]interface{} * improvement(logger): adding string to Level Parser * improvement(logger): rename ParseLevel to GetLevel
34 lines
445 B
Go
34 lines
445 B
Go
package logger
|
|
|
|
type Level int8
|
|
|
|
const (
|
|
TraceLevel Level = iota - 1
|
|
DebugLevel
|
|
InfoLevel
|
|
WarnLevel
|
|
ErrorLevel
|
|
PanicLevel
|
|
FatalLevel
|
|
)
|
|
|
|
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 ""
|
|
}
|