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

Clippy lint to disallow logging crate macros in favor of tracing #1383

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Description of the upcoming release here.
- [#1293](https://github.com/FuelLabs/fuel-core/issues/1293): Parallelized the `estimate_predicates` endpoint to utilize all available threads.
- [#1270](https://github.com/FuelLabs/fuel-core/pull/1270): Modify the way block headers are retrieved from peers to be done in batches.
- [#1342](https://github.com/FuelLabs/fuel-core/pull/1342): Add error handling for P2P requests to return `None` to requester and log error
- [#1383](https://github.com/FuelLabs/fuel-core/pull/1383): Disallow usage of `log` crate internally in favor of `tracing` crate

#### Breaking
- [#1374](https://github.com/FuelLabs/fuel-core/pull/1374): Renamed `base_chain_height` to `da_height` and return current relayer height instead of latest Fuel block height.
Expand Down
4 changes: 2 additions & 2 deletions bin/fuel-core/src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ async fn shutdown_signal() -> anyhow::Result<()> {
break;
}
_ = sigint.recv() => {
tracing::log::info!("sigint received");
tracing::info!("sigint received");
break;
}
}
Expand All @@ -457,7 +457,7 @@ async fn shutdown_signal() -> anyhow::Result<()> {
#[cfg(not(unix))]
{
tokio::signal::ctrl_c().await?;
tracing::log::info!("CTRL+C received");
tracing::info!("CTRL+C received");
}
Ok(())
}
18 changes: 18 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
disallowed-macros = [
# https://github.com/FuelLabs/fuel-core/issues/1327
# https://docs.rs/log/latest/log/#macros
{ reason = "Use tracing instead of log", path = "tracing::log::trace" },
{ reason = "Use tracing instead of log", path = "tracing::log::debug" },
{ reason = "Use tracing instead of log", path = "tracing::log::info" },
{ reason = "Use tracing instead of log", path = "tracing::log::warn" },
{ reason = "Use tracing instead of log", path = "tracing::log::error" },
{ reason = "Use tracing instead of log", path = "tracing::log::log" },
{ reason = "Use tracing instead of log", path = "tracing::log::log_enabled" },
{ reason = "Use tracing instead of log", path = "log::trace" },
{ reason = "Use tracing instead of log", path = "log::debug" },
{ reason = "Use tracing instead of log", path = "log::info" },
{ reason = "Use tracing instead of log", path = "log::warn" },
{ reason = "Use tracing instead of log", path = "log::error" },
{ reason = "Use tracing instead of log", path = "log::log" },
{ reason = "Use tracing instead of log", path = "log::log_enabled" },
]