Skip to content

Commit bd4e523

Browse files
committed
main: make console_subscriber optional
1 parent bf823cb commit bd4e523

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ static APP_USER_AGENT: &str = concat!(
2626
#[derive(Parser, Debug)]
2727
#[command(author, version, about, long_about = None)]
2828
struct Cli {
29+
#[arg(short, long, default_value_t = false)]
30+
tokio_console: bool,
2931
#[command(subcommand)]
3032
command: Commands,
3133
}
@@ -444,10 +446,14 @@ async fn run_loop(state: &mut AppState<'_>) -> Result<()> {
444446

445447
#[tokio::main]
446448
async fn main() -> Result<()> {
447-
console_subscriber::init();
448449
env_logger::init();
449450
let args = Cli::parse();
450451

452+
if args.tokio_console {
453+
eprintln!("Starting console-subscriber");
454+
console_subscriber::init();
455+
}
456+
451457
let mut secrets = Secrets::new().await?;
452458

453459
let mut state = AppState {

0 commit comments

Comments
 (0)