mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
Add console-subscriber feature for debugging (#7529)
Add `console-subscriber` feature for debugging tokio async tasks. Supersedes #7420 to work with `unstable`. Usage: - Build Lighthouse with `RUSTFLAGS=--cfg tokio_unstable` and `--features console-subscriber`, e.g.: ``` RUSTFLAGS=-"-cfg=tokio_unstable --remap-path-prefix=$(pwd)=." FEATURES=console-subscriber make ``` - Run the Lighthouse binary. - Install `tokio-console` and run it in a terminal.
This commit is contained in:
@@ -33,6 +33,8 @@ slasher-redb = ["slasher/redb"]
|
||||
beacon-node-leveldb = ["store/leveldb"]
|
||||
# Supports beacon node redb backend.
|
||||
beacon-node-redb = ["store/redb"]
|
||||
# Supports console subscriber for debugging
|
||||
console-subscriber = ["console-subscriber/default"]
|
||||
|
||||
# Deprecated. This is now enabled by default on non windows targets.
|
||||
jemalloc = []
|
||||
@@ -45,6 +47,7 @@ bls = { workspace = true }
|
||||
boot_node = { path = "../boot_node" }
|
||||
clap = { workspace = true }
|
||||
clap_utils = { workspace = true }
|
||||
console-subscriber = { workspace = true, optional = true }
|
||||
database_manager = { path = "../database_manager" }
|
||||
directory = { workspace = true }
|
||||
environment = { workspace = true }
|
||||
|
||||
@@ -663,6 +663,12 @@ fn run<E: EthSpec>(
|
||||
|
||||
logging_layers.push(MetricsLayer.boxed());
|
||||
|
||||
#[cfg(feature = "console-subscriber")]
|
||||
{
|
||||
let console_layer = console_subscriber::spawn();
|
||||
logging_layers.push(console_layer.boxed());
|
||||
}
|
||||
|
||||
let logging_result = tracing_subscriber::registry()
|
||||
.with(logging_layers)
|
||||
.try_init();
|
||||
|
||||
Reference in New Issue
Block a user