Skip to content

Commit

Permalink
Clippy lint to disallow logging crate macros in favor of tracing (Fue…
Browse files Browse the repository at this point in the history
  • Loading branch information
Dentosal authored Sep 26, 2023
1 parent 2152e39 commit 67f6c40
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
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" },
]

0 comments on commit 67f6c40

Please sign in to comment.