Skip to content

Commit fd09f10

Browse files
authored
Remove outdated logs and update validation (#174)
Signed-off-by: Arrobo, Gabriel <[email protected]>
1 parent e62faeb commit fd09f10

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.1-dev
1+
1.4.1

logger/logger_config.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"reflect"
99

1010
"github.com/asaskevich/govalidator"
11+
"go.uber.org/zap/zapcore"
1112
)
1213

1314
type Logger struct {
@@ -34,7 +35,6 @@ type Logger struct {
3435
MongoDBLibrary *LogSetting `yaml:"MongoDBLibrary" valid:"optional"`
3536
NAS *LogSetting `yaml:"NAS" valid:"optional"`
3637
NGAP *LogSetting `yaml:"NGAP" valid:"optional"`
37-
Config5g *LogSetting `yaml:"Config5g" valid:"optional"`
3838
OpenApi *LogSetting `yaml:"OpenApi" valid:"optional"`
3939
NamfCommunication *LogSetting `yaml:"NamfCommunication" valid:"optional"`
4040
NamfEventExposure *LogSetting `yaml:"NamfEventExposure" valid:"optional"`
@@ -48,7 +48,6 @@ type Logger struct {
4848
NudmUEAuthentication *LogSetting `yaml:"NudmUEAuthentication" valid:"optional"`
4949
NudmUEContextManagement *LogSetting `yaml:"NudmUEContextManagement" valid:"optional"`
5050
NudrDataRepository *LogSetting `yaml:"NudrDataRepository" valid:"optional"`
51-
PFCP *LogSetting `yaml:"PFCP" valid:"optional"`
5251
}
5352

5453
func (l *Logger) Validate() (bool, error) {
@@ -70,12 +69,10 @@ type LogSetting struct {
7069

7170
func (l *LogSetting) validate() (bool, error) {
7271
govalidator.TagMap["debugLevel"] = govalidator.Validator(func(str string) bool {
73-
if str == "panic" || str == "fatal" || str == "error" || str == "warn" ||
74-
str == "info" || str == "debug" {
72+
if _, err := zapcore.ParseLevel(str); err == nil {
7573
return true
76-
} else {
77-
return false
7874
}
75+
return false
7976
})
8077

8178
result, err := govalidator.ValidateStruct(l)

0 commit comments

Comments
 (0)