Skip to content

Commit

Permalink
penumbra: completely remove console-subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor authored and conorsch committed Apr 8, 2024
1 parent f7234c0 commit fa7a177
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 82 deletions.
57 changes: 0 additions & 57 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ chrono = { default-features = false, version = "0.4" }
clap = { version = "3.2" }
cnidarium = { default-features = false, path = "crates/cnidarium" }
cnidarium-component = { default-features = false, path = "crates/cnidarium-component" }
console-subscriber = { version = "0.2" }
criterion = { version = "0.4" }
decaf377 = { default-features = false, version = "0.5" }
decaf377-fmd = { path = "crates/crypto/decaf377-fmd" }
Expand Down
1 change: 0 additions & 1 deletion crates/bin/pd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ bytes = { workspace = true }
chrono = { workspace = true, default-features = false, features = ["serde"] }
clap = { workspace = true, features = ["derive", "env"] }
cnidarium = { workspace = true, features = ["migration", "rpc"], default-features = true }
console-subscriber = { workspace = true }
csv = "1.1"
decaf377 = { workspace = true, features = ["parallel"], default-features = true }
decaf377-rdsa = { workspace = true }
Expand Down
12 changes: 2 additions & 10 deletions crates/bin/pd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use std::error::Error;
use std::io::IsTerminal as _;

use console_subscriber::ConsoleLayer;
use metrics_tracing_context::{MetricsLayer, TracingContextLayer};
use metrics_util::layers::Stack;

Expand Down Expand Up @@ -32,7 +31,7 @@ use url::Url;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Validate options immediately.
let Opt { tokio_console, cmd } = <Opt as clap::Parser>::parse();
let Opt { cmd } = <Opt as clap::Parser>::parse();

// Instantiate tracing layers.
// The MetricsLayer handles enriching metrics output with labels from tracing spans.
Expand All @@ -49,14 +48,7 @@ async fn main() -> anyhow::Result<()> {
.with(filter_layer)
.with(fmt_layer)
.with(metrics_layer);
if tokio_console {
// The ConsoleLayer enables collection of data for `tokio-console`.
// The `spawn` call will panic if AddrInUse, so we only spawn if enabled.
let console_layer = ConsoleLayer::builder().with_default_env().spawn();
registry.with(console_layer).init();
} else {
registry.init();
}
registry.init();

tracing::info!(?cmd, version = env!("CARGO_PKG_VERSION"), "running command");
match cmd {
Expand Down
1 change: 0 additions & 1 deletion tools/summonerd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ bytes = {workspace = true}
camino = {workspace = true}
chrono = {workspace = true}
clap = {workspace = true, features = ["derive", "env", "color"]}
console-subscriber = {workspace = true}
decaf377 = {workspace = true}
futures = {workspace = true}
hex = {workspace = true}
Expand Down
14 changes: 2 additions & 12 deletions tools/summonerd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use ark_serialize::CanonicalSerialize;
use camino::Utf8Path;
use camino::Utf8PathBuf;
use clap::Parser;
use console_subscriber::ConsoleLayer;
use coordinator::Coordinator;
use decaf377::Bls12_377;
use metrics_tracing_context::MetricsLayer;
Expand Down Expand Up @@ -86,9 +85,6 @@ operating the orchestration.
version,
)]
struct Opt {
/// Enable Tokio Console support.
#[clap(long)]
tokio_console: bool,
/// Command to run.
#[clap(subcommand)]
pub cmd: Command,
Expand Down Expand Up @@ -356,8 +352,6 @@ async fn main() -> Result<()> {
// Instantiate tracing layers.
// The MetricsLayer handles enriching metrics output with labels from tracing spans.
let metrics_layer = MetricsLayer::new();
// The ConsoleLayer enables collection of data for `tokio-console`.
let console_layer = ConsoleLayer::builder().with_default_env().spawn();
// The `FmtLayer` is used to print to the console.
let fmt_layer = tracing_subscriber::fmt::layer()
.with_ansi(io::stdout().is_terminal())
Expand All @@ -369,16 +363,12 @@ async fn main() -> Result<()> {

let opt = Opt::parse();

// Register the tracing subscribers, conditionally enabling tokio console support
// Register the tracing subscribers.
let registry = tracing_subscriber::registry()
.with(filter_layer)
.with(fmt_layer)
.with(metrics_layer);
if opt.tokio_console {
registry.with(console_layer).init();
} else {
registry.init();
}
registry.init();

opt.exec().await
}

0 comments on commit fa7a177

Please sign in to comment.