mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 05:31:18 +08:00
36 lines
480 B
Go
36 lines
480 B
Go
package constant
|
|
|
|
var (
|
|
// LogLevelMapping is a mapping for LogLevel enum
|
|
LogLevelMapping = map[string]LogLevel{
|
|
"error": ERROR,
|
|
"warning": WARNING,
|
|
"info": INFO,
|
|
"debug": DEBUG,
|
|
}
|
|
)
|
|
|
|
const (
|
|
ERROR LogLevel = iota
|
|
WARNING
|
|
INFO
|
|
DEBUG
|
|
)
|
|
|
|
type LogLevel int
|
|
|
|
func (l LogLevel) String() string {
|
|
switch l {
|
|
case INFO:
|
|
return "info"
|
|
case WARNING:
|
|
return "warning"
|
|
case ERROR:
|
|
return "error"
|
|
case DEBUG:
|
|
return "debug"
|
|
default:
|
|
return "unknow"
|
|
}
|
|
}
|