From 3001a3a56f2274eaafaa956fb394f0817f526ae7 Mon Sep 17 00:00:00 2001 From: Oskar Mansfeld <113997378+mansf-osk@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:24:17 +0100 Subject: [PATCH] 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. --- neqo-bin/src/client/mod.rs | 6 +++--- neqo-common/src/qlog.rs | 2 +- neqo-transport/src/server.rs | 2 +- test-fixture/src/lib.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/neqo-bin/src/client/mod.rs b/neqo-bin/src/client/mod.rs index 35463cad31..00509951af 100644 --- a/neqo-bin/src/client/mod.rs +++ b/neqo-bin/src/client/mod.rs @@ -508,9 +508,9 @@ fn qlog_new(args: &Args, hostname: &str, cid: &ConnectionId) -> Res { NeqoQlog::enabled_with_file( qlog_dir, Role::Client, - Some("Example qlog".to_string()), - Some("Example qlog description".to_string()), - format!("{hostname}-{cid}"), + Some("Neqo client qlog".to_string()), + Some("Neqo client qlog".to_string()), + format!("client-{hostname}-{cid}"), ) .map_err(Error::QlogError) } diff --git a/neqo-common/src/qlog.rs b/neqo-common/src/qlog.rs index 34f1e1c2ca..5f7b5dca3d 100644 --- a/neqo-common/src/qlog.rs +++ b/neqo-common/src/qlog.rs @@ -186,7 +186,7 @@ pub fn new_trace(role: Role) -> qlog::TraceSeq { flow: None, }, title: Some(format!("neqo-{role} trace")), - description: Some("Example qlog trace description".to_string()), + description: Some(format!("neqo-{role} trace")), configuration: Some(Configuration { time_offset: Some(0.0), original_uris: None, diff --git a/neqo-transport/src/server.rs b/neqo-transport/src/server.rs index 286f74283c..154ad17ed3 100644 --- a/neqo-transport/src/server.rs +++ b/neqo-transport/src/server.rs @@ -271,7 +271,7 @@ impl Server { Role::Server, Some("Neqo server qlog".to_string()), Some("Neqo server qlog".to_string()), - odcid, + format!("server-{odcid}"), ) .unwrap_or_else(|e| { qerror!("failed to create NeqoQlog: {}", e); diff --git a/test-fixture/src/lib.rs b/test-fixture/src/lib.rs index f2a86f6793..e58e32f37a 100644 --- a/test-fixture/src/lib.rs +++ b/test-fixture/src/lib.rs @@ -418,6 +418,6 @@ pub fn new_neqo_qlog() -> (NeqoQlog, SharedVec) { pub const EXPECTED_LOG_HEADER: &str = concat!( "\u{1e}", - 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"}}}"#, + 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"}}}"#, "\n" );