diff --git a/Cargo.lock b/Cargo.lock index 2f74cc6f..5e94a025 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,8 +16,8 @@ dependencies = [ "fork_choice_store", "futures", "jemalloc-ctl", - "log", "rand", + "tracing", "types", ] @@ -565,10 +565,10 @@ dependencies = [ "futures", "helper_functions", "itertools 0.13.0", - "log", "prometheus_metrics", "rayon", "std_ext", + "tracing", "types", ] @@ -935,7 +935,6 @@ dependencies = [ "interop", "itertools 0.13.0", "keymanager", - "log", "nonzero_ext", "operation_pools", "prometheus_metrics", @@ -946,6 +945,7 @@ dependencies = [ "tap", "thiserror", "tokio", + "tracing", "transition_functions", "try_from_iterator", "tynm", @@ -1018,7 +1018,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", - "regex-automata", + "regex-automata 0.4.7", "serde", ] @@ -1046,7 +1046,6 @@ dependencies = [ "helper_functions", "hex-literal", "itertools 0.13.0", - "log", "prometheus_metrics", "reqwest", "serde", @@ -1055,6 +1054,7 @@ dependencies = [ "ssz", "test-case", "thiserror", + "tracing", "typenum", "types", ] @@ -1710,7 +1710,6 @@ dependencies = [ "fs-err", "im", "itertools 0.13.0", - "log", "reth-libmdbx", "snap", "std_ext", @@ -1718,6 +1717,7 @@ dependencies = [ "tempfile", "test-case", "thiserror", + "tracing", "unwrap_none", ] @@ -2253,7 +2253,6 @@ dependencies = [ "futures", "genesis", "itertools 0.13.0", - "log", "prometheus_metrics", "reqwest", "ssz", @@ -2261,6 +2260,7 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", + "tracing", "tynm", "types", "url", @@ -2285,7 +2285,6 @@ dependencies = [ "hex-literal", "httpmock", "jwt-simple", - "log", "memoffset", "panics", "prometheus_metrics", @@ -2299,6 +2298,7 @@ dependencies = [ "test-case", "thiserror", "tokio", + "tracing", "typenum", "types", "unwrap_none", @@ -2620,7 +2620,6 @@ dependencies = [ "helper_functions", "http_api_utils", "itertools 0.13.0", - "log", "mime", "nonzero_ext", "num_cpus", @@ -2639,6 +2638,7 @@ dependencies = [ "tap", "test-generator", "thiserror", + "tracing", "transition_functions", "tynm", "types", @@ -3052,7 +3052,6 @@ dependencies = [ "http_api", "itertools 0.13.0", "keymanager", - "log", "logging", "metrics", "p2p", @@ -3077,6 +3076,7 @@ dependencies = [ "thiserror", "tokio", "tower-http", + "tracing", "types", "validator", "validator_key_cache", @@ -3550,7 +3550,6 @@ dependencies = [ "itertools 0.13.0", "keymanager", "liveness_tracker", - "log", "mediatype", "metrics", "mime", @@ -3582,6 +3581,7 @@ dependencies = [ "tokio", "tokio-stream", "tower-http", + "tracing", "transition_functions", "try_from_iterator", "typenum", @@ -3600,7 +3600,6 @@ dependencies = [ "hex-literal", "http-body-util", "itertools 0.13.0", - "log", "mime", "parse-display", "prometheus_metrics", @@ -4306,7 +4305,6 @@ dependencies = [ "futures", "hex-literal", "itertools 0.13.0", - "log", "reqwest", "serde", "serde_json", @@ -4317,6 +4315,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", + "tracing", "types", "uuid", "validator_key_cache", @@ -4371,7 +4370,7 @@ dependencies = [ "petgraph", "pico-args", "regex", - "regex-syntax", + "regex-syntax 0.8.4", "string_cache", "term", "tiny-keccak", @@ -4385,7 +4384,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata", + "regex-automata 0.4.7", ] [[package]] @@ -4992,9 +4991,9 @@ dependencies = [ "futures", "helper_functions", "itertools 0.13.0", - "log", "operation_pools", "prometheus_metrics", + "tracing", "tynm", "types", "validator", @@ -5024,6 +5023,9 @@ name = "logging" version = "0.0.0" dependencies = [ "derive_more", + "tracing", + "tracing-appender", + "tracing-subscriber", ] [[package]] @@ -5059,6 +5061,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "matchit" version = "0.7.3" @@ -5104,7 +5115,6 @@ dependencies = [ "helper_functions", "http_api_utils", "jemalloc-ctl", - "log", "num_threads", "p2p", "prometheus", @@ -5120,6 +5130,7 @@ dependencies = [ "tokio", "tokio-stream", "tower-http", + "tracing", "transition_functions", "types", ] @@ -5348,6 +5359,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -5544,7 +5565,6 @@ dependencies = [ "good_lp", "helper_functions", "itertools 0.13.0", - "log", "prometheus_metrics", "rayon", "serde", @@ -5553,6 +5573,7 @@ dependencies = [ "strum", "tap", "tokio", + "tracing", "transition_functions", "try_from_iterator", "tynm", @@ -5566,6 +5587,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "p256" version = "0.13.2" @@ -5730,7 +5757,7 @@ checksum = "914a1c2265c98e2446911282c6ac86d8524f495792c38c5bd884f80499c7538a" dependencies = [ "parse-display-derive", "regex", - "regex-syntax", + "regex-syntax 0.8.4", ] [[package]] @@ -5742,7 +5769,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.36", "regex", - "regex-syntax", + "regex-syntax 0.8.4", "structmeta", "syn 2.0.68", ] @@ -6164,11 +6191,11 @@ dependencies = [ "anyhow", "features", "futures", - "log", "once_cell", "prometheus", "tokio", "tokio-stream", + "tracing", "types", ] @@ -6493,8 +6520,17 @@ checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -6505,9 +6541,15 @@ checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.4", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.4" @@ -6709,7 +6751,6 @@ dependencies = [ "http_api", "keymanager", "liveness_tracker", - "log", "metrics", "nonzero_ext", "num_cpus", @@ -6726,6 +6767,7 @@ dependencies = [ "std_ext", "thiserror", "tokio", + "tracing", "types", "validator", ] @@ -7229,6 +7271,15 @@ dependencies = [ "keccak", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shlex" version = "1.3.0" @@ -7282,7 +7333,6 @@ dependencies = [ "hex-literal", "httpmock", "itertools 0.13.0", - "log", "prometheus_metrics", "rayon", "reqwest", @@ -7294,6 +7344,7 @@ dependencies = [ "std_ext", "thiserror", "tokio", + "tracing", "types", ] @@ -7348,11 +7399,11 @@ dependencies = [ "features", "futures", "helper_functions", - "log", "p2p", "serde", "ssz", "thiserror", + "tracing", "types", "unwrap_none", ] @@ -7372,7 +7423,6 @@ dependencies = [ "helper_functions", "hex-literal", "itertools 0.13.0", - "log", "refinery", "rusqlite", "serde", @@ -7383,6 +7433,7 @@ dependencies = [ "test-case", "test-generator", "thiserror", + "tracing", "types", ] @@ -7623,11 +7674,11 @@ version = "0.1.0" dependencies = [ "anyhow", "im", - "log", "parking_lot 0.12.3", "std_ext", "tap", "thiserror", + "tracing", "types", ] @@ -8213,6 +8264,18 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-appender" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" +dependencies = [ + "crossbeam-channel", + "thiserror", + "time", + "tracing-subscriber", +] + [[package]] name = "tracing-attributes" version = "0.1.27" @@ -8231,6 +8294,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] @@ -8568,6 +8661,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "value-bag" version = "1.9.0" diff --git a/Cargo.toml b/Cargo.toml index d17c38d1..658b142c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -414,6 +414,8 @@ tokio-util = { version = '0.7', features = ['codec', 'compat', 'time'] } tower = { version = '0.4.13', features = ['timeout'] } tower-http = { version = '0.5.2', features = ['cors', 'trace'] } tracing = '0.1.40' +tracing-appender = "0.2.3" +tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } triomphe = '0.1.13' tynm = '0.1.10' typenum = '1.17.0' diff --git a/ad_hoc_bench/Cargo.toml b/ad_hoc_bench/Cargo.toml index f5ea5c3b..d583e9d7 100644 --- a/ad_hoc_bench/Cargo.toml +++ b/ad_hoc_bench/Cargo.toml @@ -17,6 +17,6 @@ fork_choice_control = { workspace = true } fork_choice_store = { workspace = true } futures = { workspace = true } jemalloc-ctl = { workspace = true } -log = { workspace = true } rand = { workspace = true } +tracing = { workspace = true } types = { workspace = true } diff --git a/ad_hoc_bench/src/main.rs b/ad_hoc_bench/src/main.rs index 3254d347..1dd38310 100644 --- a/ad_hoc_bench/src/main.rs +++ b/ad_hoc_bench/src/main.rs @@ -9,7 +9,7 @@ use eth2_cache_utils::{goerli, holesky, holesky_devnet, mainnet, medalla, withdr use fork_choice_control::AdHocBenchController; use fork_choice_store::StoreConfig; use jemalloc_ctl::Result as JemallocResult; -use log::info; +use tracing::info; use rand::seq::SliceRandom as _; use types::{ combined::{BeaconState, SignedBeaconBlock}, diff --git a/attestation_verifier/Cargo.toml b/attestation_verifier/Cargo.toml index 79399df9..52fb54e3 100644 --- a/attestation_verifier/Cargo.toml +++ b/attestation_verifier/Cargo.toml @@ -17,8 +17,8 @@ fork_choice_store = { workspace = true } futures = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } -log = { workspace = true } prometheus_metrics = { workspace = true } rayon = { workspace = true } std_ext = { workspace = true } +tracing = {workspace = true } types = { workspace = true } diff --git a/attestation_verifier/src/attestation_verifier.rs b/attestation_verifier/src/attestation_verifier.rs index dd21abb7..f6c90fa9 100644 --- a/attestation_verifier/src/attestation_verifier.rs +++ b/attestation_verifier/src/attestation_verifier.rs @@ -22,7 +22,7 @@ use helper_functions::{ verifier::{MultiVerifier, Triple, Verifier}, }; use itertools::Either; -use log::{debug, warn}; +use tracing::{debug, warn}; use prometheus_metrics::Metrics; use rayon::iter::{IntoParallelIterator as _, ParallelBridge as _, ParallelIterator as _}; use std_ext::ArcExt as _; diff --git a/block_producer/Cargo.toml b/block_producer/Cargo.toml index 26d169e1..97903119 100644 --- a/block_producer/Cargo.toml +++ b/block_producer/Cargo.toml @@ -25,7 +25,6 @@ futures = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } keymanager = { workspace = true } -log = { workspace = true } nonzero_ext = { workspace = true } operation_pools = { workspace = true } prometheus_metrics = { workspace = true } @@ -36,6 +35,7 @@ std_ext = { workspace = true } tap = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } transition_functions = { workspace = true } try_from_iterator = { workspace = true } tynm = { workspace = true } diff --git a/block_producer/src/block_producer.rs b/block_producer/src/block_producer.rs index 83caf5cc..50ad8055 100644 --- a/block_producer/src/block_producer.rs +++ b/block_producer/src/block_producer.rs @@ -23,7 +23,7 @@ use futures::{ use helper_functions::{accessors, misc, predicates}; use itertools::{Either, Itertools as _}; use keymanager::ProposerConfigs; -use log::{error, info, warn}; +use tracing::{error, info, warn}; use nonzero_ext::nonzero; use operation_pools::{ AttestationAggPool, BlsToExecutionChangePool, PoolAdditionOutcome, PoolRejectionReason, diff --git a/block_producer/src/eth1_storage.rs b/block_producer/src/eth1_storage.rs index e1f1ec1b..8517e767 100644 --- a/block_producer/src/eth1_storage.rs +++ b/block_producer/src/eth1_storage.rs @@ -13,7 +13,7 @@ use deposit_tree::DepositTree; use eth1::{DepositEvent, Eth1Block, Eth1Chain}; use helper_functions::misc::compute_timestamp_at_slot; use itertools::Itertools as _; -use log::{error, warn}; +use tracing::{error, warn}; use prometheus_metrics::Metrics; use ssz::ContiguousList; use thiserror::Error; diff --git a/builder_api/Cargo.toml b/builder_api/Cargo.toml index acd4f9cc..2b9ebc2d 100644 --- a/builder_api/Cargo.toml +++ b/builder_api/Cargo.toml @@ -14,13 +14,13 @@ derive_more = { workspace = true } helper_functions = { workspace = true } hex-literal = { workspace = true } itertools = { workspace = true } -log = { workspace = true } prometheus_metrics = { workspace = true } reqwest = { workspace = true } serde = { workspace = true } serde_utils = { workspace = true } ssz = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } typenum = { workspace = true } types = { workspace = true } diff --git a/builder_api/src/api.rs b/builder_api/src/api.rs index 75ec3012..03aaf68c 100644 --- a/builder_api/src/api.rs +++ b/builder_api/src/api.rs @@ -6,7 +6,7 @@ use bls::PublicKeyBytes; use derive_more::Constructor; use helper_functions::signing::SignForAllForks; use itertools::Itertools as _; -use log::{debug, info}; +use tracing::{debug, info}; use prometheus_metrics::Metrics; use reqwest::{Client, Response, StatusCode, Url}; use ssz::SszHash as _; diff --git a/database/Cargo.toml b/database/Cargo.toml index b08f2c1e..ada89495 100644 --- a/database/Cargo.toml +++ b/database/Cargo.toml @@ -13,11 +13,11 @@ fs-err = { workspace = true } im = { workspace = true } itertools = { workspace = true } libmdbx = { workspace = true } -log = { workspace = true } snap = { workspace = true } std_ext = { workspace = true } tap = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } unwrap_none = { workspace = true } [dev-dependencies] diff --git a/database/src/lib.rs b/database/src/lib.rs index 54eace92..7c65bfd6 100644 --- a/database/src/lib.rs +++ b/database/src/lib.rs @@ -10,7 +10,7 @@ use bytesize::ByteSize; use im::OrdMap; use itertools::Either; use libmdbx::{DatabaseFlags, Environment, Geometry, WriteFlags}; -use log::info; +use tracing::info; use snap::raw::{Decoder, Encoder}; use std_ext::ArcExt as _; use tap::Pipe as _; diff --git a/eth1/Cargo.toml b/eth1/Cargo.toml index f1a48c48..31ae8d81 100644 --- a/eth1/Cargo.toml +++ b/eth1/Cargo.toml @@ -17,7 +17,6 @@ fs-err = { workspace = true } futures = { workspace = true } genesis = { workspace = true } itertools = { workspace = true } -log = { workspace = true } prometheus_metrics = { workspace = true } reqwest = { workspace = true } ssz = { workspace = true } @@ -25,6 +24,7 @@ std_ext = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } +tracing = { workspace = true } tynm = { workspace = true } types = { workspace = true } url = { workspace = true } diff --git a/eth1/src/download_manager.rs b/eth1/src/download_manager.rs index da5f8778..fe8a87e7 100644 --- a/eth1/src/download_manager.rs +++ b/eth1/src/download_manager.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use anyhow::{Context as _, Result}; use eth1_api::{Eth1Api, Eth1ApiToMetrics, Eth1Block}; use futures::channel::mpsc::UnboundedSender; -use log::{info, warn}; +use tracing::{info, warn}; use prometheus_metrics::Metrics; use reqwest::Client; use std_ext::ArcExt as _; diff --git a/eth1/src/eth1_chain.rs b/eth1/src/eth1_chain.rs index b328f896..462a97f6 100644 --- a/eth1/src/eth1_chain.rs +++ b/eth1/src/eth1_chain.rs @@ -8,7 +8,7 @@ use futures::{ channel::mpsc::UnboundedSender, stream::{Stream, TryStreamExt as _}, }; -use log::{error, info}; +use tracing::{error, info}; use prometheus_metrics::Metrics; use reqwest::Client; use std_ext::ArcExt as _; diff --git a/eth1/src/genesis.rs b/eth1/src/genesis.rs index f515044d..86cc232a 100644 --- a/eth1/src/genesis.rs +++ b/eth1/src/genesis.rs @@ -5,7 +5,7 @@ use chrono::{Local, TimeZone as _}; use eth1_api::{DepositEvent, Eth1Block}; use futures::stream::{Stream, TryStreamExt as _}; use genesis::Incremental; -use log::info; +use tracing::info; use ssz::{SszRead as _, SszWrite as _}; use thiserror::Error; use types::{ diff --git a/eth1_api/Cargo.toml b/eth1_api/Cargo.toml index 6431d57a..71deffa0 100644 --- a/eth1_api/Cargo.toml +++ b/eth1_api/Cargo.toml @@ -21,7 +21,6 @@ futures = { workspace = true } hex = { workspace = true } hex-literal = { workspace = true } jwt-simple = { workspace = true } -log = { workspace = true } memoffset = { workspace = true } panics = { workspace = true } prometheus_metrics = { workspace = true } @@ -33,6 +32,7 @@ static_assertions = { workspace = true } std_ext = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } typenum = { workspace = true } types = { workspace = true } web3 = { workspace = true } diff --git a/eth1_api/src/eth1_api.rs b/eth1_api/src/eth1_api.rs index 476b7c3c..de9acdb6 100644 --- a/eth1_api/src/eth1_api.rs +++ b/eth1_api/src/eth1_api.rs @@ -11,7 +11,7 @@ use execution_engine::{ ForkChoiceUpdatedResponse, PayloadAttributes, PayloadId, PayloadStatusV1, }; use futures::{channel::mpsc::UnboundedSender, lock::Mutex, Future}; -use log::warn; +use tracing::warn; use prometheus_metrics::Metrics; use reqwest::{header::HeaderMap, Client, Url}; use serde::{de::DeserializeOwned, Deserialize}; diff --git a/eth1_api/src/eth1_execution_engine.rs b/eth1_api/src/eth1_execution_engine.rs index c07390c1..0df9d8aa 100644 --- a/eth1_api/src/eth1_execution_engine.rs +++ b/eth1_api/src/eth1_execution_engine.rs @@ -5,7 +5,7 @@ use derive_more::Constructor; use either::Either; use execution_engine::{ExecutionEngine, PayloadAttributes, PayloadId, PayloadStatusV1}; use futures::channel::{mpsc::UnboundedSender, oneshot::Sender}; -use log::{info, warn}; +use tracing::{info, warn}; use tokio::runtime::{Builder, Handle}; use types::{ combined::{ExecutionPayload, ExecutionPayloadParams}, diff --git a/eth1_api/src/execution_service.rs b/eth1_api/src/execution_service.rs index 0827d89e..c77425de 100644 --- a/eth1_api/src/execution_service.rs +++ b/eth1_api/src/execution_service.rs @@ -6,7 +6,7 @@ use either::Either; use execution_engine::{ForkChoiceUpdatedResponse, PayloadAttributes, PayloadStatusV1}; use fork_choice_control::Wait; use futures::{channel::mpsc::UnboundedReceiver, StreamExt as _}; -use log::warn; +use tracing::warn; use types::{ combined::{ExecutionPayload, ExecutionPayloadParams}, nonstandard::Phase, diff --git a/eth1_api/src/messages.rs b/eth1_api/src/messages.rs index 02f02764..da433efd 100644 --- a/eth1_api/src/messages.rs +++ b/eth1_api/src/messages.rs @@ -2,7 +2,7 @@ use anyhow::Result; use either::Either; use execution_engine::{PayloadAttributes, PayloadId, PayloadStatusV1}; use futures::channel::{mpsc::UnboundedSender, oneshot::Sender}; -use log::debug; +use tracing::debug; use types::{ combined::{ExecutionPayload, ExecutionPayloadParams}, nonstandard::Phase, diff --git a/fork_choice_control/Cargo.toml b/fork_choice_control/Cargo.toml index 0f12d8d2..4b706869 100644 --- a/fork_choice_control/Cargo.toml +++ b/fork_choice_control/Cargo.toml @@ -26,7 +26,6 @@ genesis = { workspace = true } helper_functions = { workspace = true } http_api_utils = { workspace = true } itertools = { workspace = true } -log = { workspace = true } mime = { workspace = true } nonzero_ext = { workspace = true } num_cpus = { workspace = true } @@ -42,6 +41,7 @@ std_ext = { workspace = true } strum = { workspace = true } tap = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } transition_functions = { workspace = true } tynm = { workspace = true } types = { workspace = true } diff --git a/fork_choice_control/src/checkpoint_sync.rs b/fork_choice_control/src/checkpoint_sync.rs index 3957dacc..b35bffa6 100644 --- a/fork_choice_control/src/checkpoint_sync.rs +++ b/fork_choice_control/src/checkpoint_sync.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use anyhow::{bail, Result}; use helper_functions::misc; use http_api_utils::{BlockId, StateId}; -use log::info; +use tracing::info; use mime::APPLICATION_OCTET_STREAM; use reqwest::{header::ACCEPT, Client, StatusCode, Url}; use ssz::SszRead; diff --git a/fork_choice_control/src/messages.rs b/fork_choice_control/src/messages.rs index 5dbd459c..65e14532 100644 --- a/fork_choice_control/src/messages.rs +++ b/fork_choice_control/src/messages.rs @@ -13,7 +13,7 @@ use fork_choice_store::{ ChainLink, Store, }; use helper_functions::{accessors, misc}; -use log::debug; +use tracing::debug; use serde::Serialize; use tap::Pipe as _; use types::{ diff --git a/fork_choice_control/src/mutator.rs b/fork_choice_control/src/mutator.rs index ea781c8d..41a13432 100644 --- a/fork_choice_control/src/mutator.rs +++ b/fork_choice_control/src/mutator.rs @@ -39,7 +39,7 @@ use fork_choice_store::{ use futures::channel::{mpsc::Sender as MultiSender, oneshot::Sender as OneshotSender}; use helper_functions::{accessors, misc, predicates, verifier::NullVerifier}; use itertools::{Either, Itertools as _}; -use log::{debug, error, info, warn}; +use tracing::{debug, error, info, warn}; use prometheus_metrics::Metrics; use ssz::SszHash as _; use std_ext::ArcExt as _; diff --git a/fork_choice_control/src/storage.rs b/fork_choice_control/src/storage.rs index e3f76670..91f92fc8 100644 --- a/fork_choice_control/src/storage.rs +++ b/fork_choice_control/src/storage.rs @@ -9,7 +9,7 @@ use fork_choice_store::{ChainLink, Store}; use genesis::AnchorCheckpointProvider; use helper_functions::{accessors, misc}; use itertools::Itertools as _; -use log::{debug, info, warn}; +use tracing::{debug, info, warn}; use nonzero_ext::nonzero; use reqwest::{Client, Url}; use ssz::{Ssz, SszRead, SszReadDefault as _, SszWrite}; diff --git a/fork_choice_control/src/storage_back_sync.rs b/fork_choice_control/src/storage_back_sync.rs index 28681161..560b11e2 100644 --- a/fork_choice_control/src/storage_back_sync.rs +++ b/fork_choice_control/src/storage_back_sync.rs @@ -5,7 +5,7 @@ use arithmetic::U64Ext as _; use features::Feature; use genesis::AnchorCheckpointProvider; use helper_functions::misc; -use log::{info, warn}; +use tracing::{info, warn}; use ssz::SszHash as _; use std_ext::ArcExt as _; use transition_functions::combined; diff --git a/fork_choice_control/src/storage_tool.rs b/fork_choice_control/src/storage_tool.rs index 549bed87..6df66e2f 100644 --- a/fork_choice_control/src/storage_tool.rs +++ b/fork_choice_control/src/storage_tool.rs @@ -2,7 +2,7 @@ use std::path::{Path, PathBuf}; use anyhow::Result; use genesis::AnchorCheckpointProvider; -use log::info; +use tracing::info; use ssz::{SszHash as _, SszRead, SszWrite as _}; use std_ext::ArcExt as _; use thiserror::Error; diff --git a/fork_choice_control/src/tasks.rs b/fork_choice_control/src/tasks.rs index 35292c5e..812d977a 100644 --- a/fork_choice_control/src/tasks.rs +++ b/fork_choice_control/src/tasks.rs @@ -17,7 +17,7 @@ use helper_functions::{ accessors, misc, verifier::{MultiVerifier, NullVerifier}, }; -use log::{debug, warn}; +use tracing::{debug, warn}; use prometheus_metrics::Metrics; use types::{ combined::SignedBeaconBlock, diff --git a/fork_choice_control/src/thread_pool.rs b/fork_choice_control/src/thread_pool.rs index f091cc2f..3a6cbd4c 100644 --- a/fork_choice_control/src/thread_pool.rs +++ b/fork_choice_control/src/thread_pool.rs @@ -17,7 +17,7 @@ use anyhow::Result; use derivative::Derivative; use derive_more::From; use execution_engine::ExecutionEngine; -use log::debug; +use tracing::debug; use parking_lot::{Condvar, Mutex}; use std_ext::ArcExt as _; use types::preset::Preset; diff --git a/grandine/Cargo.toml b/grandine/Cargo.toml index e5cde9ae..7b187d38 100644 --- a/grandine/Cargo.toml +++ b/grandine/Cargo.toml @@ -36,7 +36,6 @@ hex-literal = { workspace = true } http_api = { workspace = true } itertools = { workspace = true } keymanager = { workspace = true } -log = { workspace = true } logging = { workspace = true } metrics = { workspace = true } p2p = { workspace = true } @@ -59,6 +58,7 @@ tap = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } tower-http = { workspace = true } +tracing = {workspace = true} types = { workspace = true } validator = { workspace = true } validator_key_cache = { workspace = true } diff --git a/grandine/src/grandine_args.rs b/grandine/src/grandine_args.rs index fe8b00b4..bc1300a9 100644 --- a/grandine/src/grandine_args.rs +++ b/grandine/src/grandine_args.rs @@ -30,7 +30,7 @@ use fork_choice_store::{StoreConfig, DEFAULT_CACHE_LOCK_TIMEOUT_MILLIS}; use grandine_version::{APPLICATION_NAME, APPLICATION_NAME_AND_VERSION, APPLICATION_VERSION}; use http_api::HttpApiConfig; use itertools::{EitherOrBoth, Itertools as _}; -use log::warn; +use tracing::warn; use metrics::{MetricsServerConfig, MetricsServiceConfig}; use p2p::{Enr, Multiaddr, NetworkConfig}; use prometheus_metrics::{Metrics, METRICS}; diff --git a/grandine/src/grandine_config.rs b/grandine/src/grandine_config.rs index 0f257764..32139021 100644 --- a/grandine/src/grandine_config.rs +++ b/grandine/src/grandine_config.rs @@ -5,12 +5,11 @@ use builder_api::BuilderConfig; use eth1_api::AuthOptions; use features::Feature; use http_api::HttpApiConfig; -use itertools::Itertools as _; -use log::info; use p2p::NetworkConfig; use reqwest::Url; use runtime::{MetricsConfig, StorageConfig}; use signer::Web3SignerConfig; +use tracing::info; use types::{ config::Config as ChainConfig, phase0::primitives::{ExecutionAddress, ExecutionBlockNumber, Slot, H256}, @@ -110,7 +109,7 @@ impl GrandineConfig { storage_config.eth1_db_size.to_string_as(true), ); - info!("Eth1 RPC URLs: [{}]", eth1_rpc_urls.iter().format(", ")); + info!("Eth1 RPC URLs: {:?}", eth1_rpc_urls); info!("graffiti: {graffiti:?}"); info!("HTTP API address: {}", http_api_config.address); @@ -151,8 +150,8 @@ impl GrandineConfig { if !web3signer_config.urls.is_empty() { info!( - "using Web3Signer API to sign validator messages (API URLs: [{}])", - web3signer_config.urls.iter().format(", "), + "using Web3Signer API to sign validator messages (API URLs: {:?})", + web3signer_config.urls, ); } diff --git a/grandine/src/main.rs b/grandine/src/main.rs index aa6e2d75..95035f3f 100644 --- a/grandine/src/main.rs +++ b/grandine/src/main.rs @@ -19,8 +19,7 @@ use fork_choice_store::StoreConfig; use genesis::AnchorCheckpointProvider; use grandine_version::APPLICATION_VERSION_WITH_PLATFORM; use http_api::HttpApiConfig; -use log::{error, info, warn}; -use logging::PEER_LOG_METRICS; +use logging::{setup_tracing, PEER_LOG_METRICS}; use metrics::MetricsServerConfig; use p2p::{ListenAddr, NetworkConfig}; use reqwest::{Client, ClientBuilder, Url}; @@ -32,6 +31,7 @@ use ssz::SszRead as _; use std_ext::ArcExt as _; use thiserror::Error; use tokio::runtime::Builder; +use tracing::{error, info, warn}; use types::{ config::Config as ChainConfig, phase0::primitives::{ExecutionBlockNumber, Slot}, @@ -308,6 +308,8 @@ enum Error { } fn main() -> ExitCode { + let _guard = setup_tracing(); + info!("Grandine firing up..."); if let Err(error) = try_main() { error.downcast_ref().map(ClapError::exit); error!("{error:?}"); diff --git a/grandine/src/predefined_network.rs b/grandine/src/predefined_network.rs index d1e62e05..8595434e 100644 --- a/grandine/src/predefined_network.rs +++ b/grandine/src/predefined_network.rs @@ -5,7 +5,7 @@ use anyhow::{bail, Context as _, Result}; use deposit_tree::DepositTree; use fork_choice_control::checkpoint_sync; use genesis::AnchorCheckpointProvider; -use log::info; +use tracing::info; use p2p::{Enr, NetworkConfig}; use reqwest::{Client, Url}; use ssz::SszRead as _; diff --git a/grandine/src/validators.rs b/grandine/src/validators.rs index 54fcffe1..bae4bde7 100644 --- a/grandine/src/validators.rs +++ b/grandine/src/validators.rs @@ -3,7 +3,7 @@ use std::{collections::HashMap, path::PathBuf, sync::Arc}; use anyhow::{Error, Result}; use bls::{PublicKeyBytes, SecretKey}; use eip_2335::Keystore; -use log::{info, warn}; +use tracing::{info, warn}; use rayon::iter::{IntoParallelIterator as _, ParallelIterator as _}; use signer::KeyOrigin; use std_ext::ArcExt; diff --git a/http_api/Cargo.toml b/http_api/Cargo.toml index bcf7d6a2..4df98e00 100644 --- a/http_api/Cargo.toml +++ b/http_api/Cargo.toml @@ -26,7 +26,6 @@ helper_functions = { workspace = true } http_api_utils = { workspace = true } itertools = { workspace = true } liveness_tracker = { workspace = true } -log = { workspace = true } mediatype = { workspace = true } metrics = { workspace = true } mime = { workspace = true } @@ -49,6 +48,7 @@ thiserror = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } tower-http = { workspace = true } +tracing = { workspace = true } transition_functions = { workspace = true } try_from_iterator = { workspace = true } typenum = { workspace = true } diff --git a/http_api/src/standard.rs b/http_api/src/standard.rs index f39d9d82..e46d36ff 100644 --- a/http_api/src/standard.rs +++ b/http_api/src/standard.rs @@ -33,7 +33,7 @@ use helper_functions::{accessors, misc}; use http_api_utils::{BlockId, StateId}; use itertools::{izip, Either, Itertools as _}; use liveness_tracker::ApiToLiveness; -use log::{debug, info, warn}; +use tracing::{debug, info, warn}; use operation_pools::{ AttestationAggPool, BlsToExecutionChangePool, Origin, PoolAdditionOutcome, SyncCommitteeAggPool, }; diff --git a/http_api/src/task.rs b/http_api/src/task.rs index 42078ac0..ed5ba7c5 100644 --- a/http_api/src/task.rs +++ b/http_api/src/task.rs @@ -16,7 +16,7 @@ use futures::{ use genesis::AnchorCheckpointProvider; use http_api_utils::ApiMetrics; use liveness_tracker::ApiToLiveness; -use log::{debug, info}; +use tracing::{debug, info}; use metrics::ApiToMetrics; use operation_pools::{ AttestationAggPool, BlsToExecutionChangePool, PoolToApiMessage, SyncCommitteeAggPool, diff --git a/http_api_utils/Cargo.toml b/http_api_utils/Cargo.toml index dae1daba..c785016f 100644 --- a/http_api_utils/Cargo.toml +++ b/http_api_utils/Cargo.toml @@ -12,7 +12,6 @@ axum = { workspace = true } features = { workspace = true } http-body-util = { workspace = true } itertools = { workspace = true } -log = { workspace = true } mime = { workspace = true } parse-display = { workspace = true } prometheus_metrics = { workspace = true } diff --git a/http_api_utils/src/logging.rs b/http_api_utils/src/logging.rs index 4fa94028..7e7dd2ad 100644 --- a/http_api_utils/src/logging.rs +++ b/http_api_utils/src/logging.rs @@ -8,7 +8,7 @@ use axum::{ response::Response, }; use features::Feature; -use log::{info, warn}; +use tracing::{info, warn}; use tracing::Span; use crate::{misc::ApiMetrics, ApiError}; diff --git a/http_api_utils/src/middleware.rs b/http_api_utils/src/middleware.rs index 810d3a6f..2374f9aa 100644 --- a/http_api_utils/src/middleware.rs +++ b/http_api_utils/src/middleware.rs @@ -13,7 +13,7 @@ use axum::{ Extension, }; use http_body_util::BodyExt as _; -use log::info; +use tracing::info; use mime::{APPLICATION_JSON, TEXT_EVENT_STREAM}; use crate::{error::Error, misc::Direction}; diff --git a/keymanager/Cargo.toml b/keymanager/Cargo.toml index 35ec2189..798a8861 100644 --- a/keymanager/Cargo.toml +++ b/keymanager/Cargo.toml @@ -15,7 +15,6 @@ eip_2335 = { workspace = true } fs-err = { workspace = true } futures = { workspace = true } itertools = { workspace = true } -log = { workspace = true } reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } @@ -25,6 +24,7 @@ std_ext = { workspace = true } tap = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } types = { workspace = true } uuid = { workspace = true } validator_key_cache = { workspace = true } diff --git a/keymanager/src/keystores.rs b/keymanager/src/keystores.rs index 626ee9b6..878aad05 100644 --- a/keymanager/src/keystores.rs +++ b/keymanager/src/keystores.rs @@ -9,7 +9,7 @@ use bls::{PublicKeyBytes, SecretKey}; use eip_2335::Keystore; use futures::lock::{MappedMutexGuard, Mutex, MutexGuard}; use itertools::Itertools as _; -use log::{info, warn}; +use tracing::{info, warn}; use serde::Serialize; use signer::{KeyOrigin, Signer}; use slashing_protection::{interchange_format::InterchangeFormat, SlashingProtector}; diff --git a/liveness_tracker/Cargo.toml b/liveness_tracker/Cargo.toml index 7bf0d410..b0445e32 100644 --- a/liveness_tracker/Cargo.toml +++ b/liveness_tracker/Cargo.toml @@ -14,9 +14,9 @@ fork_choice_control = { workspace = true } futures = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } -log = { workspace = true } operation_pools = { workspace = true } prometheus_metrics = { workspace = true } +tracing = { workspace = true } tynm = { workspace = true } types = { workspace = true } validator = { workspace = true } diff --git a/liveness_tracker/src/lib.rs b/liveness_tracker/src/lib.rs index 71e0e31c..84b636ab 100644 --- a/liveness_tracker/src/lib.rs +++ b/liveness_tracker/src/lib.rs @@ -7,7 +7,7 @@ use fork_choice_control::Wait; use futures::{channel::mpsc::UnboundedReceiver, select, StreamExt as _}; use helper_functions::{accessors, misc}; use itertools::Itertools as _; -use log::{debug, warn}; +use tracing::{debug, warn}; use operation_pools::PoolToLivenessMessage; use prometheus_metrics::Metrics; use types::{ diff --git a/liveness_tracker/src/messages.rs b/liveness_tracker/src/messages.rs index 7be12ed0..f97a918c 100644 --- a/liveness_tracker/src/messages.rs +++ b/liveness_tracker/src/messages.rs @@ -1,6 +1,6 @@ use anyhow::Result; use futures::channel::{mpsc::UnboundedSender, oneshot::Sender}; -use log::debug; +use tracing::debug; use types::phase0::primitives::{Epoch, ValidatorIndex}; pub enum ApiToLiveness { diff --git a/logging/Cargo.toml b/logging/Cargo.toml index 52c5fdfa..50dd4b5d 100644 --- a/logging/Cargo.toml +++ b/logging/Cargo.toml @@ -8,3 +8,6 @@ workspace = true [dependencies] derive_more = { workspace = true } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } +tracing-appender = { workspace = true } diff --git a/logging/src/lib.rs b/logging/src/lib.rs index 662ae421..fb95544f 100644 --- a/logging/src/lib.rs +++ b/logging/src/lib.rs @@ -1,6 +1,10 @@ use core::sync::atomic::{AtomicUsize, Ordering}; use derive_more::Display; +use tracing::info; +use tracing_appender::non_blocking::NonBlocking; +use tracing_appender::rolling::{RollingFileAppender, Rotation}; +use tracing_subscriber::{fmt, layer::SubscriberExt, EnvFilter}; pub static PEER_LOG_METRICS: PeerLogMetrics = PeerLogMetrics::new(0); @@ -30,3 +34,28 @@ impl PeerLogMetrics { .store(target_peer_count, Ordering::Relaxed) } } + +pub fn setup_tracing() -> impl Drop { + let log_path = "logs/testing.log"; + let log_appender = RollingFileAppender::new(Rotation::DAILY, "", log_path); + let (file_non_blocking, file_guard) = NonBlocking::new(log_appender); + + let stdout_layer = fmt::layer().with_writer(std::io::stdout).with_ansi(true); + + let file_layer = fmt::layer().with_writer(file_non_blocking).with_ansi(false); + + let env_filter = EnvFilter::try_from_default_env() + .or_else(|_| EnvFilter::try_new("info")) + .expect("Failed to create EnvFilter"); + + let subscriber = tracing_subscriber::registry() + .with(env_filter) + .with(stdout_layer) + .with(file_layer); + + tracing::subscriber::set_global_default(subscriber) + .expect("Failed to initialize tracing subscriber"); + + info!("Tracing initialized successfully."); + file_guard +} diff --git a/metrics/Cargo.toml b/metrics/Cargo.toml index 69be48e3..340d28da 100644 --- a/metrics/Cargo.toml +++ b/metrics/Cargo.toml @@ -21,7 +21,6 @@ grandine_version = { workspace = true } helper_functions = { workspace = true } http_api_utils = { workspace = true } jemalloc-ctl = { workspace = true } -log = { workspace = true } num_threads = { workspace = true } p2p = { workspace = true } prometheus = { workspace = true } @@ -37,6 +36,7 @@ thiserror = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } tower-http = { workspace = true } +tracing = { workspace = true } transition_functions = { workspace = true } types = { workspace = true } diff --git a/metrics/src/beaconchain.rs b/metrics/src/beaconchain.rs index 4d2a3cc0..f3a590e3 100644 --- a/metrics/src/beaconchain.rs +++ b/metrics/src/beaconchain.rs @@ -12,7 +12,7 @@ use chrono::DateTime; use eth1_api::{Eth1ConnectionData, Eth1Metrics}; use grandine_version::{APPLICATION_NAME, APPLICATION_VERSION}; use helper_functions::{accessors, predicates}; -use log::warn; +use tracing::warn; use p2p::metrics::PEERS_CONNECTED; use prometheus::IntGauge; use psutil::{cpu::CpuTimes, process::Process}; diff --git a/metrics/src/messages.rs b/metrics/src/messages.rs index f5a1c6f2..6c858df6 100644 --- a/metrics/src/messages.rs +++ b/metrics/src/messages.rs @@ -1,6 +1,6 @@ use anyhow::Result; use futures::channel::{mpsc::UnboundedSender, oneshot::Sender}; -use log::debug; +use tracing::debug; use types::nonstandard::SystemStats; pub enum ApiToMetrics { diff --git a/metrics/src/server.rs b/metrics/src/server.rs index 85f6f8ef..ee089e22 100644 --- a/metrics/src/server.rs +++ b/metrics/src/server.rs @@ -21,7 +21,7 @@ use fork_choice_control::Wait; use futures::channel::mpsc::UnboundedSender; use helper_functions::misc; use http_api_utils::ApiError; -use log::{info, warn}; +use tracing::{info, warn}; use prometheus::TextEncoder; use prometheus_client::registry::Registry; use prometheus_metrics::Metrics; diff --git a/metrics/src/service.rs b/metrics/src/service.rs index 87315612..edf011d0 100644 --- a/metrics/src/service.rs +++ b/metrics/src/service.rs @@ -6,7 +6,7 @@ use bls::PublicKeyBytes; use directories::Directories; use eth1_api::{Eth1ApiToMetrics, Eth1Metrics, RealController}; use futures::{channel::mpsc::UnboundedReceiver, future::Either, select, StreamExt as _}; -use log::{debug, info, warn}; +use tracing::{debug, info, warn}; use p2p::SyncToMetrics; use reqwest::{Client, StatusCode, Url}; use serde::Deserialize; diff --git a/operation_pools/Cargo.toml b/operation_pools/Cargo.toml index cc819cee..cc02e88f 100644 --- a/operation_pools/Cargo.toml +++ b/operation_pools/Cargo.toml @@ -21,7 +21,6 @@ futures = { workspace = true } good_lp = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } -log = { workspace = true } prometheus_metrics = { workspace = true } rayon = { workspace = true } serde = { workspace = true } @@ -30,6 +29,7 @@ std_ext = { workspace = true } strum = { workspace = true } tap = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } transition_functions = { workspace = true } try_from_iterator = { workspace = true } tynm = { workspace = true } diff --git a/operation_pools/src/bls_to_execution_change_pool.rs b/operation_pools/src/bls_to_execution_change_pool.rs index 98cb7028..f52effeb 100644 --- a/operation_pools/src/bls_to_execution_change_pool.rs +++ b/operation_pools/src/bls_to_execution_change_pool.rs @@ -12,7 +12,7 @@ use futures::{ }; use helper_functions::predicates; use itertools::Itertools as _; -use log::{debug, warn}; +use tracing::{debug, warn}; use prometheus_metrics::Metrics; use transition_functions::capella; use types::{ diff --git a/operation_pools/src/messages.rs b/operation_pools/src/messages.rs index aa82fd37..121a30e8 100644 --- a/operation_pools/src/messages.rs +++ b/operation_pools/src/messages.rs @@ -1,6 +1,6 @@ use eth2_libp2p::GossipId; use futures::channel::mpsc::UnboundedSender; -use log::debug; +use tracing::debug; use serde::Serialize; use types::{ altair::containers::SyncCommitteeMessage, capella::containers::SignedBlsToExecutionChange, diff --git a/operation_pools/src/sync_committee_agg_pool/pool.rs b/operation_pools/src/sync_committee_agg_pool/pool.rs index 68e51f59..1bb15ebd 100644 --- a/operation_pools/src/sync_committee_agg_pool/pool.rs +++ b/operation_pools/src/sync_committee_agg_pool/pool.rs @@ -3,7 +3,7 @@ use std::{collections::HashSet, sync::Arc}; use anyhow::{anyhow, Result}; use helper_functions::accessors; use itertools::Itertools as _; -use log::debug; +use tracing::debug; use prometheus_metrics::Metrics; use std_ext::ArcExt as _; use tokio::sync::RwLock; diff --git a/operation_pools/src/sync_committee_agg_pool/tasks.rs b/operation_pools/src/sync_committee_agg_pool/tasks.rs index c69517eb..b9f2edef 100644 --- a/operation_pools/src/sync_committee_agg_pool/tasks.rs +++ b/operation_pools/src/sync_committee_agg_pool/tasks.rs @@ -11,7 +11,7 @@ use helper_functions::{ signing::{SignForSingleFork as _, SignForSingleForkAtSlot as _}, verifier::{MultiVerifier, Verifier as _}, }; -use log::{debug, warn}; +use tracing::{debug, warn}; use prometheus_metrics::Metrics; use typenum::Unsigned as _; use types::{ diff --git a/prometheus_metrics/Cargo.toml b/prometheus_metrics/Cargo.toml index 5aff72e8..c765aeed 100644 --- a/prometheus_metrics/Cargo.toml +++ b/prometheus_metrics/Cargo.toml @@ -8,9 +8,9 @@ authors = ["Grandine "] anyhow = { workspace = true } features = { workspace = true } futures = { workspace = true } -log = { workspace = true } once_cell = { workspace = true } prometheus = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } +tracing = { workspace = true } types = { workspace = true } diff --git a/prometheus_metrics/src/helpers.rs b/prometheus_metrics/src/helpers.rs index b0cd16b7..3476ad70 100644 --- a/prometheus_metrics/src/helpers.rs +++ b/prometheus_metrics/src/helpers.rs @@ -1,7 +1,7 @@ use std::time::{Duration, SystemTime}; use anyhow::Result; -use log::warn; +use tracing::warn; use prometheus::{Histogram, HistogramTimer, HistogramVec}; use types::phase0::primitives::UnixSeconds; diff --git a/prometheus_metrics/src/metrics.rs b/prometheus_metrics/src/metrics.rs index 1e5e1965..33ac364f 100644 --- a/prometheus_metrics/src/metrics.rs +++ b/prometheus_metrics/src/metrics.rs @@ -2,7 +2,7 @@ use core::time::Duration; use std::sync::Arc; use anyhow::Result; -use log::warn; +use tracing::warn; use once_cell::sync::OnceCell; use prometheus::{ histogram_opts, opts, Gauge, GaugeVec, Histogram, HistogramVec, IntCounter, IntCounterVec, diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c669dd6a..870c083f 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -27,7 +27,6 @@ grandine_version = { workspace = true } http_api = { workspace = true } keymanager = { workspace = true } liveness_tracker = { workspace = true } -log = { workspace = true } metrics = { workspace = true } nonzero_ext = { workspace = true } num_cpus = { workspace = true } @@ -44,5 +43,6 @@ slashing_protection = { workspace = true } std_ext = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } types = { workspace = true } validator = { workspace = true } diff --git a/runtime/src/runtime.rs b/runtime/src/runtime.rs index 7cca34be..8cf9c644 100644 --- a/runtime/src/runtime.rs +++ b/runtime/src/runtime.rs @@ -26,7 +26,7 @@ use genesis::AnchorCheckpointProvider; use http_api::{Channels as HttpApiChannels, HttpApi, HttpApiConfig}; use keymanager::KeyManager; use liveness_tracker::LivenessTracker; -use log::{info, warn}; +use tracing::{info, warn}; use metrics::{run_metrics_server, MetricsChannels, MetricsService}; use operation_pools::{ AttestationAggPool, BlsToExecutionChangePool, Manager, SyncCommitteeAggPool, diff --git a/runtime/src/schema.rs b/runtime/src/schema.rs index 198e1ede..325a5627 100644 --- a/runtime/src/schema.rs +++ b/runtime/src/schema.rs @@ -2,7 +2,7 @@ use std::{io::ErrorKind, path::Path}; use anyhow::{bail, ensure, Result}; use grandine_version::APPLICATION_NAME; -use log::info; +use tracing::info; use semver::{Version, VersionReq}; use serde::{Deserialize, Serialize}; use thiserror::Error; diff --git a/signer/Cargo.toml b/signer/Cargo.toml index 787506b7..9736a3de 100644 --- a/signer/Cargo.toml +++ b/signer/Cargo.toml @@ -14,7 +14,6 @@ builder_api = { workspace = true } futures = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } -log = { workspace = true } prometheus_metrics = { workspace = true } rayon = { workspace = true } reqwest = { workspace = true } @@ -24,6 +23,7 @@ slashing_protection = { workspace = true } std_ext = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true } +tracing = { workspace = true } types = { workspace = true } [dev-dependencies] diff --git a/signer/src/signer.rs b/signer/src/signer.rs index cd7d07eb..5446a91a 100644 --- a/signer/src/signer.rs +++ b/signer/src/signer.rs @@ -13,7 +13,7 @@ use futures::{ }; use helper_functions::misc; use itertools::{izip, Itertools as _}; -use log::{info, warn}; +use tracing::{info, warn}; use prometheus_metrics::Metrics; use rayon::iter::{IntoParallelIterator as _, ParallelIterator as _}; use reqwest::{Client, Url}; diff --git a/signer/src/web3signer/api.rs b/signer/src/web3signer/api.rs index 02978926..d6ec58fb 100644 --- a/signer/src/web3signer/api.rs +++ b/signer/src/web3signer/api.rs @@ -5,7 +5,7 @@ use std::{ use anyhow::Result; use bls::{PublicKeyBytes, SignatureBytes}; -use log::warn; +use tracing::warn; use prometheus_metrics::Metrics; use reqwest::{Client, Url}; use types::{phase0::primitives::H256, preset::Preset}; diff --git a/slasher/Cargo.toml b/slasher/Cargo.toml index aab5dd38..095fd74c 100644 --- a/slasher/Cargo.toml +++ b/slasher/Cargo.toml @@ -17,11 +17,11 @@ eth1_api = { workspace = true } features = { workspace = true } futures = { workspace = true } helper_functions = { workspace = true } -log = { workspace = true } p2p = { workspace = true } serde = { workspace = true } ssz = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } types = { workspace = true } [dev-dependencies] diff --git a/slasher/src/messages.rs b/slasher/src/messages.rs index 880c48ff..b55ca361 100644 --- a/slasher/src/messages.rs +++ b/slasher/src/messages.rs @@ -1,5 +1,5 @@ use futures::channel::mpsc::UnboundedSender; -use log::warn; +use tracing::warn; use types::{ phase0::{ containers::{AttesterSlashing, ProposerSlashing}, diff --git a/slasher/src/slasher.rs b/slasher/src/slasher.rs index b0ceb702..6124437a 100644 --- a/slasher/src/slasher.rs +++ b/slasher/src/slasher.rs @@ -11,7 +11,7 @@ use futures::{ stream::StreamExt, }; use helper_functions::{accessors, misc}; -use log::{debug, info, warn}; +use tracing::{debug, info, warn}; use p2p::P2pToSlasher; use thiserror::Error; use types::{ diff --git a/slashing_protection/Cargo.toml b/slashing_protection/Cargo.toml index 5752600c..8109a3b4 100644 --- a/slashing_protection/Cargo.toml +++ b/slashing_protection/Cargo.toml @@ -15,7 +15,6 @@ fs-err = { workspace = true } glob = { workspace = true } helper_functions = { workspace = true } itertools = { workspace = true } -log = { workspace = true } refinery = { workspace = true } rusqlite = { workspace = true } serde = { workspace = true } @@ -23,6 +22,7 @@ serde_json = { workspace = true } serde_utils = { workspace = true } ssz = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } types = { workspace = true } [dev-dependencies] diff --git a/slashing_protection/src/lib.rs b/slashing_protection/src/lib.rs index 3a456536..1e016b07 100644 --- a/slashing_protection/src/lib.rs +++ b/slashing_protection/src/lib.rs @@ -7,7 +7,7 @@ use derivative::Derivative; use fs_err::File; use helper_functions::{accessors, misc}; use itertools::Itertools as _; -use log::{debug, info, warn}; +use tracing::{debug, info, warn}; use rusqlite::{Connection, OptionalExtension, Rows, Transaction, TransactionBehavior}; use ssz::{SszReadDefault as _, SszWrite as _}; use thiserror::Error; diff --git a/state_cache/Cargo.toml b/state_cache/Cargo.toml index 5cca36f1..c3793c9b 100644 --- a/state_cache/Cargo.toml +++ b/state_cache/Cargo.toml @@ -10,9 +10,9 @@ workspace = true [dependencies] anyhow = { workspace = true } im = { workspace = true } -log = { workspace = true } parking_lot = { workspace = true } std_ext = { workspace = true } tap = { workspace = true } thiserror = { workspace = true } +tracing = { workspace = true } types = { workspace = true } diff --git a/state_cache/src/state_cache.rs b/state_cache/src/state_cache.rs index d2879b3f..a5146ffa 100644 --- a/state_cache/src/state_cache.rs +++ b/state_cache/src/state_cache.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use anyhow::{anyhow, Result}; use im::{HashMap, OrdMap}; -use log::{info, warn}; +use tracing::{info, warn}; use parking_lot::{Mutex, MutexGuard}; use std_ext::ArcExt as _; use tap::Pipe as _;