Skip to content

Commit

Permalink
chore(qlog): Add meaningful qlog titles and descriptions. (#2281)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
mansf-osk authored Dec 12, 2024
1 parent b4d0eb7 commit 3001a3a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions neqo-bin/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,9 @@ fn qlog_new(args: &Args, hostname: &str, cid: &ConnectionId) -> Res<NeqoQlog> {
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)
}
Expand Down
2 changes: 1 addition & 1 deletion neqo-common/src/qlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion neqo-transport/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test-fixture/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);

0 comments on commit 3001a3a

Please sign in to comment.