Skip to content

Commit 3001a3a

Browse files
authored
chore(qlog): Add meaningful qlog titles and descriptions. (#2281)
* chore(qlog): Add meaningful qlog titles and descriptions. * chore(qlog) Add client prefix to client qlog filename. * chore(qlog): Change EXPECTED_LOG_HEADER so tests pass.
1 parent b4d0eb7 commit 3001a3a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

neqo-bin/src/client/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,9 @@ fn qlog_new(args: &Args, hostname: &str, cid: &ConnectionId) -> Res<NeqoQlog> {
508508
NeqoQlog::enabled_with_file(
509509
qlog_dir,
510510
Role::Client,
511-
Some("Example qlog".to_string()),
512-
Some("Example qlog description".to_string()),
513-
format!("{hostname}-{cid}"),
511+
Some("Neqo client qlog".to_string()),
512+
Some("Neqo client qlog".to_string()),
513+
format!("client-{hostname}-{cid}"),
514514
)
515515
.map_err(Error::QlogError)
516516
}

neqo-common/src/qlog.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ pub fn new_trace(role: Role) -> qlog::TraceSeq {
186186
flow: None,
187187
},
188188
title: Some(format!("neqo-{role} trace")),
189-
description: Some("Example qlog trace description".to_string()),
189+
description: Some(format!("neqo-{role} trace")),
190190
configuration: Some(Configuration {
191191
time_offset: Some(0.0),
192192
original_uris: None,

neqo-transport/src/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl Server {
271271
Role::Server,
272272
Some("Neqo server qlog".to_string()),
273273
Some("Neqo server qlog".to_string()),
274-
odcid,
274+
format!("server-{odcid}"),
275275
)
276276
.unwrap_or_else(|e| {
277277
qerror!("failed to create NeqoQlog: {}", e);

test-fixture/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,6 @@ pub fn new_neqo_qlog() -> (NeqoQlog, SharedVec) {
418418

419419
pub const EXPECTED_LOG_HEADER: &str = concat!(
420420
"\u{1e}",
421-
r#"{"qlog_version":"0.3","qlog_format":"JSON-SEQ","trace":{"vantage_point":{"name":"neqo-Client","type":"client"},"title":"neqo-Client trace","description":"Example qlog trace description","configuration":{"time_offset":0.0},"common_fields":{"reference_time":0.0,"time_format":"relative"}}}"#,
421+
r#"{"qlog_version":"0.3","qlog_format":"JSON-SEQ","trace":{"vantage_point":{"name":"neqo-Client","type":"client"},"title":"neqo-Client trace","description":"neqo-Client trace","configuration":{"time_offset":0.0},"common_fields":{"reference_time":0.0,"time_format":"relative"}}}"#,
422422
"\n"
423423
);

0 commit comments

Comments
 (0)