From b5e5d7e2bad6a7d3d52b683e694cfbbd9279ea25 Mon Sep 17 00:00:00 2001 From: DragonBillow Date: Sat, 2 Mar 2024 21:31:09 +0800 Subject: [PATCH] refactor(log): replace log with tracing Signed-off-by: DragonBillow --- Cargo.lock | 1 - Cargo.toml | 1 - src/dump.rs | 2 +- src/main.rs | 2 +- src/openvsx_ext.rs | 2 +- src/request/http_client.rs | 2 +- src/utils.rs | 2 +- src/utils/cacher.rs | 2 +- 8 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4060860..9d8924f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -772,7 +772,6 @@ dependencies = [ "bitflags 2.4.0", "clap 4.4.2", "futures", - "log", "minijinja", "nixpkgs-fmt", "openvsx", diff --git a/Cargo.toml b/Cargo.toml index e242f43..2b1c072 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,6 @@ serde = { version = "1.0.188", features = ["derive", "alloc", "rc"] serde_json = "1.0.106" toml = "0.7.8" tokio = { version = "1.32.0", features = ["full"] } -log = "0.4.20" tracing = "0.1.37" tracing-subscriber = { version = "0.3.17", features = ["env-filter", "std"] } semver = "1.0.18" diff --git a/src/dump.rs b/src/dump.rs index 6d3d035..cd12607 100644 --- a/src/dump.rs +++ b/src/dump.rs @@ -1,6 +1,6 @@ use futures::future::join_all; -use log::*; use semver::Version; +use tracing::*; use crate::{ config::Config, diff --git a/src/main.rs b/src/main.rs index cca7a2a..af5cb28 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,10 +13,10 @@ pub mod request; pub mod utils; use data_struct::IRawGalleryExtension; -use log::*; use openvsx::apis::configuration::Configuration; use semver::Version; use std::{str::FromStr, sync::Arc}; +use tracing::*; use tracing_subscriber::{fmt, prelude::*, util::SubscriberInitExt, EnvFilter}; use futures::future::join_all; diff --git a/src/openvsx_ext.rs b/src/openvsx_ext.rs index 858db39..b228cc1 100644 --- a/src/openvsx_ext.rs +++ b/src/openvsx_ext.rs @@ -2,7 +2,7 @@ use std::str::FromStr; -use log::*; +use tracing::*; use openvsx::{ apis::{configuration::Configuration, registry_api_api}, diff --git a/src/request/http_client.rs b/src/request/http_client.rs index fa3ff6c..ab31dcc 100644 --- a/src/request/http_client.rs +++ b/src/request/http_client.rs @@ -6,7 +6,7 @@ use crate::{ }; use super::Query; -use log::*; +use tracing::*; #[derive(Debug, Clone)] pub struct HttpClient { diff --git a/src/utils.rs b/src/utils.rs index 8b25b4a..74f5205 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -3,7 +3,7 @@ mod cacher; pub use cacher::*; use crate::error::Error; -use log::*; +use tracing::*; pub async fn get_sha256(url: &str) -> anyhow::Result { trace!("get sha256 of {url}"); diff --git a/src/utils/cacher.rs b/src/utils/cacher.rs index 9c3fb4d..aa40db9 100644 --- a/src/utils/cacher.rs +++ b/src/utils/cacher.rs @@ -1,6 +1,6 @@ -use log::*; use redb::{ReadableTable, TableDefinition}; use std::{path::PathBuf, sync::LazyLock}; +use tracing::*; use crate::error::Error;