-
Notifications
You must be signed in to change notification settings - Fork 126
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
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. |
Failed Interop TestsQUIC Interop Runner, client vs. server, differences relative to b070663. neqo-latest as client
neqo-latest as server
All resultsSucceeded Interop TestsQUIC Interop Runner, client vs. server neqo-latest as client
neqo-latest as server
Unsupported Interop TestsQUIC Interop Runner, client vs. server neqo-latest as client
neqo-latest as server
|
Nit: Remove trailing dots to make messages more consistent.
neqo_common::log
with log
crate
neqo_common::log
with log
crateneqo_common::log
and enforce clippy format checks
Signed-off-by: Lars Eggert <[email protected]>
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)*); } ); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
.
Also move variables into format strings where possible and make some other minor improvements.
Offshoot off #1963.