From a96a20f4782b376925e4340e9528a06bc592acf5 Mon Sep 17 00:00:00 2001 From: Theo Butler Date: Wed, 8 Nov 2023 10:11:33 -0500 Subject: [PATCH] fix(common): replace log with tracing Previously, all logs emitted from the common package would not appear. --- Cargo.lock | 2 +- common/Cargo.toml | 2 +- common/src/allocations/monitor.rs | 2 +- common/src/attestations/dispute_manager.rs | 2 +- common/src/attestations/signers.rs | 2 +- common/src/escrow_accounts.rs | 2 +- common/src/indexer_errors.rs | 2 +- common/src/subgraph_client/client.rs | 2 +- common/src/subgraph_client/monitor.rs | 2 +- common/src/tap_manager.rs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 84dea637f..483418c29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2889,7 +2889,6 @@ dependencies = [ "graphql", "keccak-hash", "lazy_static", - "log", "lru", "once_cell", "prometheus", @@ -2903,6 +2902,7 @@ dependencies = [ "test-log", "tokio", "toolshed", + "tracing", "wiremock", ] diff --git a/common/Cargo.toml b/common/Cargo.toml index 11ee31fa4..768e25c5c 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -14,7 +14,6 @@ eventuals = "0.6.7" faux = { version = "0.1.10", optional = true } keccak-hash = "0.10.0" lazy_static = "1.4.0" -log = "0.4.20" lru = "0.11.1" once_cell = "1.17" prometheus = "0.13.3" @@ -34,6 +33,7 @@ tokio = { version = "1.32.0", features = ["full", "macros", "rt"] } toolshed = { git = "https://github.com/edgeandnode/toolshed", branch = "main", features = [ "graphql", ] } +tracing = "0.1.34" graphql = { git = "https://github.com/edgeandnode/toolshed", branch = "main" } tap_core = "0.6.0" diff --git a/common/src/allocations/monitor.rs b/common/src/allocations/monitor.rs index c26d08a13..69dfdf74c 100644 --- a/common/src/allocations/monitor.rs +++ b/common/src/allocations/monitor.rs @@ -6,10 +6,10 @@ use std::{collections::HashMap, time::Duration}; use alloy_primitives::Address; use anyhow::anyhow; use eventuals::{timer, Eventual, EventualExt}; -use log::warn; use serde::Deserialize; use serde_json::json; use tokio::time::sleep; +use tracing::warn; use crate::prelude::SubgraphClient; diff --git a/common/src/attestations/dispute_manager.rs b/common/src/attestations/dispute_manager.rs index 5a071b6d5..9b1dba33c 100644 --- a/common/src/attestations/dispute_manager.rs +++ b/common/src/attestations/dispute_manager.rs @@ -5,10 +5,10 @@ use std::time::Duration; use alloy_primitives::Address; use eventuals::{timer, Eventual, EventualExt}; -use log::warn; use serde::Deserialize; use serde_json::json; use tokio::time::sleep; +use tracing::warn; use crate::subgraph_client::SubgraphClient; diff --git a/common/src/attestations/signers.rs b/common/src/attestations/signers.rs index ca230e955..edf3c57e8 100644 --- a/common/src/attestations/signers.rs +++ b/common/src/attestations/signers.rs @@ -4,7 +4,7 @@ use alloy_primitives::Address; use ethers_core::types::U256; use eventuals::{join, Eventual, EventualExt}; -use log::warn; +use tracing::warn; use std::collections::HashMap; use std::sync::Arc; use tokio::sync::Mutex; diff --git a/common/src/escrow_accounts.rs b/common/src/escrow_accounts.rs index 3d91cd4d4..842b48ba6 100644 --- a/common/src/escrow_accounts.rs +++ b/common/src/escrow_accounts.rs @@ -7,10 +7,10 @@ use alloy_primitives::Address; use anyhow::Result; use ethers_core::types::U256; use eventuals::{timer, Eventual, EventualExt}; -use log::{error, warn}; use serde::Deserialize; use serde_json::json; use tokio::time::sleep; +use tracing::{error, warn}; use crate::prelude::SubgraphClient; diff --git a/common/src/indexer_errors.rs b/common/src/indexer_errors.rs index 76e373a5d..08be7fdf1 100644 --- a/common/src/indexer_errors.rs +++ b/common/src/indexer_errors.rs @@ -6,7 +6,7 @@ use std::{ fmt::{self, Display}, }; -use log::warn; +use tracing::warn; use crate::metrics; diff --git a/common/src/subgraph_client/client.rs b/common/src/subgraph_client/client.rs index d893a6c2e..060e40e08 100644 --- a/common/src/subgraph_client/client.rs +++ b/common/src/subgraph_client/client.rs @@ -4,11 +4,11 @@ use anyhow::anyhow; use eventuals::Eventual; use graphql::http::Response; -use log::warn; use reqwest::{header, Url}; use serde::de::Deserialize; use serde_json::Value; use toolshed::thegraph::DeploymentId; +use tracing::warn; use super::monitor::{monitor_deployment_status, DeploymentStatus}; diff --git a/common/src/subgraph_client/monitor.rs b/common/src/subgraph_client/monitor.rs index 177d96da1..180d67e30 100644 --- a/common/src/subgraph_client/monitor.rs +++ b/common/src/subgraph_client/monitor.rs @@ -5,12 +5,12 @@ use std::time::Duration; use eventuals::{timer, Eventual, EventualExt}; use graphql::http::Response; -use log::warn; use reqwest::{header, Url}; use serde::Deserialize; use serde_json::{json, Value}; use tokio::time::sleep; use toolshed::thegraph::DeploymentId; +use tracing::warn; #[derive(Deserialize)] #[serde(rename_all = "camelCase")] diff --git a/common/src/tap_manager.rs b/common/src/tap_manager.rs index 32edd786a..ba4a3e187 100644 --- a/common/src/tap_manager.rs +++ b/common/src/tap_manager.rs @@ -6,10 +6,10 @@ use alloy_sol_types::Eip712Domain; use anyhow::anyhow; use ethers_core::types::U256; use eventuals::Eventual; -use log::error; use sqlx::{types::BigDecimal, PgPool}; use std::{collections::HashMap, sync::Arc}; use tap_core::tap_manager::SignedReceipt; +use tracing::error; use crate::prelude::Allocation;