fix: resolved comments
This commit is contained in:
@@ -51,7 +51,7 @@ var logLevels = map[Level]zerolog.Level{
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
Level Level `yaml:"level"`
|
Level Level `yaml:"level"`
|
||||||
Destinations []Destination `yaml:"destinations"`
|
Destinations []Destination `yaml:"destinations"`
|
||||||
ContextKeys []any `yaml:"contextKeys"`
|
ContextKeys []string `yaml:"contextKeys"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -122,8 +122,8 @@ func getLogger(config Config) (zerolog.Logger, error) {
|
|||||||
return newLogger, fmt.Errorf("failed to create log directory: %v", err)
|
return newLogger, fmt.Errorf("failed to create log directory: %v", err)
|
||||||
}
|
}
|
||||||
lumberjackLogger := &lumberjack.Logger{
|
lumberjackLogger := &lumberjack.Logger{
|
||||||
Filename: filePath,
|
Filename: filePath,
|
||||||
Compress: false,
|
Compress: false,
|
||||||
}
|
}
|
||||||
absPath, err := filepath.Abs(filePath)
|
absPath, err := filepath.Abs(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -255,7 +255,7 @@ func addCtx(ctx context.Context, event *zerolog.Event) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
keyStr := key.(string)
|
keyStr := key
|
||||||
event.Any(keyStr, val)
|
event.Any(keyStr, val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ func setupLogger(t *testing.T, l Level) string {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ContextKeys: []any{"userID", "requestID"},
|
ContextKeys: []string{"userID", "requestID"},
|
||||||
}
|
}
|
||||||
err = InitLogger(config)
|
err = InitLogger(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user