add recorder for serial handler

This commit is contained in:
ginuerzh
2023-09-18 21:13:11 +08:00
parent a623232cc1
commit a743862f23
9 changed files with 188 additions and 26 deletions

View File

@ -167,9 +167,15 @@ func ParseService(cfg *config.ServiceConfig) (service.Service, error) {
var recorders []recorder.RecorderObject
for _, r := range cfg.Recorders {
md := metadata.NewMetadata(r.Metadata)
recorders = append(recorders, recorder.RecorderObject{
Recorder: registry.RecorderRegistry().Get(r.Name),
Record: r.Record,
Options: &recorder.Options{
Direction: mdutil.GetBool(md, mdKeyRecorderDirection),
TimestampFormat: mdutil.GetString(md, mdKeyRecorderTimestampFormat),
Hexdump: mdutil.GetBool(md, mdKeyRecorderHexdump),
},
})
}