mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +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:
@@ -2,8 +2,8 @@ use beacon_chain::{BeaconChain, BeaconChainTypes, LightClientProducerEvent};
|
||||
use beacon_processor::work_reprocessing_queue::ReprocessQueueMessage;
|
||||
use futures::channel::mpsc::Receiver;
|
||||
use futures::StreamExt;
|
||||
use slog::{error, Logger};
|
||||
use tokio::sync::mpsc::Sender;
|
||||
use tracing::error;
|
||||
|
||||
// Each `LightClientProducerEvent` is ~200 bytes. With the light_client server producing only recent
|
||||
// updates it is okay to drop some events in case of overloading. In normal network conditions
|
||||
@@ -15,7 +15,6 @@ pub async fn compute_light_client_updates<T: BeaconChainTypes>(
|
||||
chain: &BeaconChain<T>,
|
||||
mut light_client_server_rv: Receiver<LightClientProducerEvent<T::EthSpec>>,
|
||||
reprocess_tx: Sender<ReprocessQueueMessage>,
|
||||
log: &Logger,
|
||||
) {
|
||||
// Should only receive events for recent blocks, import_block filters by blocks close to clock.
|
||||
//
|
||||
@@ -28,12 +27,12 @@ pub async fn compute_light_client_updates<T: BeaconChainTypes>(
|
||||
chain
|
||||
.recompute_and_cache_light_client_updates(event)
|
||||
.unwrap_or_else(|e| {
|
||||
error!(log, "error computing light_client updates {:?}", e);
|
||||
error!("error computing light_client updates {:?}", e);
|
||||
});
|
||||
|
||||
let msg = ReprocessQueueMessage::NewLightClientOptimisticUpdate { parent_root };
|
||||
if reprocess_tx.try_send(msg).is_err() {
|
||||
error!(log, "Failed to inform light client update"; "parent_root" => %parent_root)
|
||||
error!(%parent_root,"Failed to inform light client update")
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user