Restore netbird state and log level after debug (#2047)

This commit is contained in:
Viktor Liu
2024-05-24 13:27:41 +02:00
committed by GitHub
parent f3214527ea
commit d13fb0e379
6 changed files with 347 additions and 134 deletions

28
client/server/log.go Normal file
View File

@ -0,0 +1,28 @@
package server
import (
"strings"
"github.com/netbirdio/netbird/client/proto"
)
func ParseLogLevel(level string) proto.LogLevel {
switch strings.ToLower(level) {
case "panic":
return proto.LogLevel_PANIC
case "fatal":
return proto.LogLevel_FATAL
case "error":
return proto.LogLevel_ERROR
case "warn":
return proto.LogLevel_WARN
case "info":
return proto.LogLevel_INFO
case "debug":
return proto.LogLevel_DEBUG
case "trace":
return proto.LogLevel_TRACE
default:
return proto.LogLevel_UNKNOWN
}
}