-
Notifications
You must be signed in to change notification settings - Fork 734
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
LevelFilter
documents its comparison logic as the opposite of reality
#1669
Comments
@davidbarsky, since you love working on docs so much, mind fixing this? :) |
@hawkw I'll take care of it today! |
Resolves #1669. Namely, I: - fixed the incorrect docs on `LevelFilter`. - Removed a stray backtick on `LevelFilter::current`. - Added a matching backtick in Level's documentation. I did _not_ add example of comparing a level against a `LevelFilter`; I instead pointed readers to Level's documentation.
Resolves #1669. Namely, I: - fixed the incorrect docs on `LevelFilter`. - Removed a stray backtick on `LevelFilter::current`. - Added a matching backtick in Level's documentation. I did _not_ add example of comparing a level against a `LevelFilter`; I instead pointed readers to Level's documentation.
Resolves #1669. Namely, I: - fixed the incorrect docs on `LevelFilter`. - Removed a stray backtick on `LevelFilter::current`. - Added a matching backtick in Level's documentation. I did _not_ add example of comparing a level against a `LevelFilter`; I instead pointed readers to Level's documentation.
I noticed that this was probably not intentional, due to a mistake in the underlying comparison functions (see #2367). Wouldn't it be better to fix the implementation than to adjust the documentation to the unexpected behavior? |
@juumixx (responding here for any readers who might be following along) I explained why this is intentional on #2367 (comment). The documentation issue was unfortunate, but that's because there are several moving parts. |
Thanks, I guess whoever wrote the documentation was likewise confused by the behavior as I was. |
These docs were updated (in response to tokio-rs#1669), but the "or equal to" phrase should have been moved to the other case. Fixes: tokio-rs#1993
These docs were updated (in response to #1669), but the "or equal to" phrase should have been moved to the other case. Fixes: #1993 ## Motivation When these docs were updated in response to #1669, they were updated incompletely (a level that is equal to a filter is _enabled_, not _disabled_) and therefore remained incorrect. ## Solution The docs were updated, moving the "or equal to" phrase to the other case.
These docs were updated (in response to #1669), but the "or equal to" phrase should have been moved to the other case. Fixes: #1993 ## Motivation When these docs were updated in response to #1669, they were updated incompletely (a level that is equal to a filter is _enabled_, not _disabled_) and therefore remained incorrect. ## Solution The docs were updated, moving the "or equal to" phrase to the other case.
These docs were updated (in response to #1669), but the "or equal to" phrase should have been moved to the other case. Fixes: #1993 ## Motivation When these docs were updated in response to #1669, they were updated incompletely (a level that is equal to a filter is _enabled_, not _disabled_) and therefore remained incorrect. ## Solution The docs were updated, moving the "or equal to" phrase to the other case.
…-rs#2767) These docs were updated (in response to tokio-rs#1669), but the "or equal to" phrase should have been moved to the other case. Fixes: tokio-rs#1993 ## Motivation When these docs were updated in response to tokio-rs#1669, they were updated incompletely (a level that is equal to a filter is _enabled_, not _disabled_) and therefore remained incorrect. ## Solution The docs were updated, moving the "or equal to" phrase to the other case.
…-rs#2767) These docs were updated (in response to tokio-rs#1669), but the "or equal to" phrase should have been moved to the other case. Fixes: tokio-rs#1993 ## Motivation When these docs were updated in response to tokio-rs#1669, they were updated incompletely (a level that is equal to a filter is _enabled_, not _disabled_) and therefore remained incorrect. ## Solution The docs were updated, moving the "or equal to" phrase to the other case.
Bug Report
Version
Current published
tracing-core
andtracing
, as well as the version currently documented on tracing.rs.Crates
tracing-core
Description
The documentation for
LevelFilter
statesThis is the exact opposite of how it works.
LevelFilter
compares the same wayLevel
does, whereERROR
is the lowest level andTRACE
is the highest, with the addition ofOFF
as comparing less thanERROR
. So the intended logic here is "if aLevel
is less than or equal to aLevelFilter
it should be considered enabled; if greater than theLevelFilter
, that level is disabled". Thankfully theLevelFilter::current()
documentation is correct.It would also be lovely to have a code sample added that demonstrates comparing a level against
LevelFilter::current()
, to help demonstrate how such comparisons work.Side note: the
LevelFilter::current()
docs have a stray`
at the end.The text was updated successfully, but these errors were encountered: