mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 20:02:43 +00:00
Integrate tracing (#6339)
Tracing Integration
- [reference](5bbf1859e9/projects/project-ideas.md (L297))
- [x] replace slog & log with tracing throughout the codebase
- [x] implement custom crit log
- [x] make relevant changes in the formatter
- [x] replace sloggers
- [x] re-write SSE logging components
cc: @macladson @eserilev
This commit is contained in:
@@ -1,22 +1,19 @@
|
||||
//! The subnet predicate used for searching for a particular subnet.
|
||||
use super::*;
|
||||
use crate::types::{EnrAttestationBitfield, EnrSyncCommitteeBitfield};
|
||||
use slog::trace;
|
||||
use std::ops::Deref;
|
||||
use tracing::trace;
|
||||
use types::data_column_custody_group::compute_subnets_for_node;
|
||||
use types::ChainSpec;
|
||||
|
||||
/// Returns the predicate for a given subnet.
|
||||
pub fn subnet_predicate<E>(
|
||||
subnets: Vec<Subnet>,
|
||||
log: &slog::Logger,
|
||||
spec: Arc<ChainSpec>,
|
||||
) -> impl Fn(&Enr) -> bool + Send
|
||||
where
|
||||
E: EthSpec,
|
||||
{
|
||||
let log_clone = log.clone();
|
||||
|
||||
move |enr: &Enr| {
|
||||
let attestation_bitfield: EnrAttestationBitfield<E> = match enr.attestation_bitfield::<E>()
|
||||
{
|
||||
@@ -48,9 +45,8 @@ where
|
||||
|
||||
if !predicate {
|
||||
trace!(
|
||||
log_clone,
|
||||
"Peer found but not on any of the desired subnets";
|
||||
"peer_id" => %enr.peer_id()
|
||||
peer_id = %enr.peer_id(),
|
||||
"Peer found but not on any of the desired subnets"
|
||||
);
|
||||
}
|
||||
predicate
|
||||
|
||||
Reference in New Issue
Block a user