mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-19 23:03:08 +00:00
cleanup shell/point/config
This commit is contained in:
1 parent
e1c58fae2b
commit
8bee0c4a7b
18 files changed
+341
-37
No files matched your search
@@ -0,0 +1,35 @@
|
||||
package json
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/v2ray/v2ray-core/common/log"
|
||||
)
|
||||
|
||||
type LogConfig struct {
|
||||
AccessLogValue string `json:"access"`
|
||||
ErrorLogValue string `json:"error"`
|
||||
LogLevelValue string `json:"loglevel"`
|
||||
}
|
||||
|
||||
func (this *LogConfig) AccessLog() string {
|
||||
return this.AccessLogValue
|
||||
}
|
||||
|
||||
func (this *LogConfig) ErrorLog() string {
|
||||
return this.ErrorLogValue
|
||||
}
|
||||
|
||||
func (this *LogConfig) LogLevel() log.LogLevel {
|
||||
level := strings.ToLower(this.LogLevelValue)
|
||||
switch level {
|
||||
case "debug":
|
||||
return log.DebugLevel
|
||||
case "info":
|
||||
return log.InfoLevel
|
||||
case "error":
|
||||
return log.ErrorLevel
|
||||
default:
|
||||
return log.WarningLevel
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user