resolved reqpreprocessing review comments

1. added logs for contextKey parsing and unmarshaling yml file.
2. resolved router test case issue.
2. resolved logger test case issues.
This commit is contained in:
MohitKatare-protean
2025-04-06 17:09:59 +05:30
parent 278e217c64
commit ec62a3242b
7 changed files with 176 additions and 70 deletions

View File

@@ -12,6 +12,7 @@ import (
"sync"
"time"
"github.com/beckn/beckn-onix/pkg/model"
"github.com/rs/zerolog"
"gopkg.in/natefinch/lumberjack.v2"
)
@@ -52,9 +53,9 @@ var logLevels = map[level]zerolog.Level{
// Config represents the configuration for logging.
type Config struct {
Level level `yaml:"level"`
Destinations []destination `yaml:"destinations"`
ContextKeys []string `yaml:"contextKeys"`
Level level `yaml:"level"`
Destinations []destination `yaml:"destinations"`
ContextKeys []model.ContextKey `yaml:"contextKeys"`
}
var (
@@ -277,7 +278,7 @@ func addCtx(ctx context.Context, event *zerolog.Event) {
if !ok {
continue
}
keyStr := key
keyStr := string(key)
event.Any(keyStr, val)
}
}