From 3ebdd1df5e10e3c018bc547339983baa8c1ea0e5 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 19 Apr 2023 15:06:19 +0200 Subject: [PATCH] qlog: move the quic-go version to the configuration field (#3735) --- qlog/trace.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/qlog/trace.go b/qlog/trace.go index fbd7e7399..bb1d5bb8f 100644 --- a/qlog/trace.go +++ b/qlog/trace.go @@ -18,10 +18,19 @@ func (l topLevel) MarshalJSONObject(enc *gojay.Encoder) { enc.StringKey("qlog_format", "NDJSON") enc.StringKey("qlog_version", "draft-02") enc.StringKeyOmitEmpty("title", "quic-go qlog") - enc.StringKey("code_version", quicGoVersion) + enc.ObjectKey("configuration", configuration{Version: quicGoVersion}) enc.ObjectKey("trace", l.trace) } +type configuration struct { + Version string +} + +func (c configuration) IsNil() bool { return false } +func (c configuration) MarshalJSONObject(enc *gojay.Encoder) { + enc.StringKey("code_version", c.Version) +} + type vantagePoint struct { Name string Type protocol.Perspective