Replace use of log with tracing (#527)

Resolved #522

* Add dep tracing v0.1.37 to binstalk
* Use `tracing` instead of `log` for logging in binstalk
* Rm dev dep `env_logger` since `log` is no longer used
* Rm unused dep `log` from binstalk

* Replace use of `log` with `tracing` in crates/bin
* Enable feat std of dep log in crates/bin

* Add dep tracing v0.1.37 to binstalk-downloader
* Replace use of `log` with `tracing` in binstalk-downloader
* Rm unused dep `log` from binstalk-downlaoder


* Wrap `ops::{install, resolve}` in `tracing::instrument`
* Wrap `Download::and_{extract, visit_tar}` in `instrument`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-11-13 19:45:37 +11:00 committed by GitHub
parent 9e80cf0700
commit 4e875874b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 38 additions and 47 deletions

View file

@ -26,7 +26,7 @@ binstalk = { path = "../binstalk", version = "0.4.1" }
clap = { version = "4.0.22", features = ["derive"] }
crates_io_api = { version = "0.8.1", default-features = false }
dirs = "4.0.0"
log = "0.4.17"
log = { version = "0.4.17", features = ["std"] }
miette = "5.4.1"
mimalloc = { version = "0.1.31", default-features = false, optional = true }
once_cell = "1.16.0"

View file

@ -13,9 +13,10 @@ use binstalk::{
resolve::{CrateName, Resolution, VersionReqExt},
},
};
use log::{debug, error, info, warn, LevelFilter};
use log::LevelFilter;
use miette::{miette, Result, WrapErr};
use tokio::task::block_in_place;
use tracing::{debug, error, info, warn};
use crate::{
args::{Args, Strategy},

View file

@ -5,7 +5,7 @@ use std::{
};
use binstalk::home::cargo_home;
use log::debug;
use tracing::debug;
pub fn get_cargo_roots_path(cargo_roots: Option<PathBuf>) -> Option<PathBuf> {
if let Some(p) = cargo_roots {

View file

@ -1,7 +1,7 @@
use std::time::Instant;
use binstalk::helpers::jobserver_client::LazyJobserverClient;
use log::debug;
use tracing::debug;
use cargo_binstall::{
args,