fix: resolved comments

This commit is contained in:
mayur.popli
2025-03-26 10:42:56 +05:30
parent f8ffe0793d
commit 708f9485cb
2 changed files with 5 additions and 5 deletions

View File

@@ -51,7 +51,7 @@ var logLevels = map[Level]zerolog.Level{
type Config struct {
Level Level `yaml:"level"`
Destinations []Destination `yaml:"destinations"`
ContextKeys []any `yaml:"contextKeys"`
ContextKeys []string `yaml:"contextKeys"`
}
var (
@@ -122,8 +122,8 @@ func getLogger(config Config) (zerolog.Logger, error) {
return newLogger, fmt.Errorf("failed to create log directory: %v", err)
}
lumberjackLogger := &lumberjack.Logger{
Filename: filePath,
Compress: false,
Filename: filePath,
Compress: false,
}
absPath, err := filepath.Abs(filePath)
if err != nil {
@@ -255,7 +255,7 @@ func addCtx(ctx context.Context, event *zerolog.Event) {
if !ok {
continue
}
keyStr := key.(string)
keyStr := key
event.Any(keyStr, val)
}
}

View File

@@ -43,7 +43,7 @@ func setupLogger(t *testing.T, l Level) string {
},
},
},
ContextKeys: []any{"userID", "requestID"},
ContextKeys: []string{"userID", "requestID"},
}
err = InitLogger(config)
if err != nil {