Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Simplify neqo_common::log and enforce clippy format checks #2291

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

larseggert
Copy link
Collaborator

@larseggert larseggert commented Dec 18, 2024

Also move variables into format strings where possible and make some other minor improvements.

Offshoot off #1963.

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 83.53175% with 83 lines in your changes missing coverage. Please review.

Project coverage is 93.33%. Comparing base (bb45c74) to head (8853788).

Files with missing lines Patch % Lines
neqo-transport/src/connection/mod.rs 83.69% 15 Missing ⚠️
neqo-transport/src/send_stream.rs 61.53% 10 Missing ⚠️
neqo-transport/src/server.rs 52.63% 9 Missing ⚠️
neqo-transport/src/crypto.rs 81.25% 6 Missing ⚠️
neqo-http3/src/connection_client.rs 82.75% 5 Missing ⚠️
neqo-qpack/src/encoder_instructions.rs 50.00% 5 Missing ⚠️
neqo-http3/src/push_controller.rs 78.57% 3 Missing ⚠️
neqo-http3/src/recv_message.rs 70.00% 3 Missing ⚠️
neqo-common/src/qlog.rs 0.00% 2 Missing ⚠️
neqo-crypto/src/agent.rs 77.77% 2 Missing ⚠️
... and 18 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2291      +/-   ##
==========================================
- Coverage   93.33%   93.33%   -0.01%     
==========================================
  Files         114      114              
  Lines       36896    36841      -55     
  Branches    36896    36841      -55     
==========================================
- Hits        34438    34386      -52     
+ Misses       1675     1671       -4     
- Partials      783      784       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Dec 18, 2024

Failed Interop Tests

QUIC Interop Runner, client vs. server, differences relative to b070663.

neqo-latest as client

neqo-latest as server

All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

@larseggert larseggert changed the title fix: Replace neqo_common::log with log crate fix: Replace neqo_common::log with log crate Dec 18, 2024
@larseggert larseggert changed the title fix: Replace neqo_common::log with log crate fix: Simplify neqo_common::log and enforce clippy format checks Dec 18, 2024
macro_rules! qerror {
([$ctx:expr], $($arg:tt)*) => (::neqo_common::log_invoke!(::log::Level::Error, $ctx, $($arg)*););
($($arg:tt)*) => ( { ::neqo_common::log::init(None); ::neqo_common::do_log!(::log::Level::Error, $($arg)*); } );
($($arg:tt)*) => ( { ::neqo_common::log::init(None); ::log::error!($($arg)*); } );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just use log::trace, etc... directly? I think that most uses of the crate will need to run an init function anyway (for NSS if nothing else), so we can avoid doing the implicit init stuff in a wrapper and rely on people calling the initialization beforehand.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1963. The issue is that if we use log directly, we need to init the module in each test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I would observe that perhaps we could keep the wrappers, but avoid the extra initialization step except when we have cfg(test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants