cargo-binstall/crates/detect-targets/src/main.rs
Tamir Duberstein 2db8e254bc
Investigate incorrect target detection (#1376)
* detect-targets: add debug tracing

See #1375.

* Add new feature `tracing` & `cli-tracing` to `detect-targets

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* Fix clippy lints

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

---------

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-09-23 10:45:44 +00:00

23 lines
488 B
Rust

use std::io;
use detect_targets::detect_targets;
use tokio::runtime;
fn main() -> io::Result<()> {
#[cfg(feature = "cli-logging")]
tracing_subscriber::fmt::fmt()
.with_max_level(tracing::Level::TRACE)
.with_writer(std::io::stderr)
.init();
let targets = runtime::Builder::new_current_thread()
.enable_all()
.build()?
.block_on(detect_targets());
for target in targets {
println!("{target}");
}
Ok(())
}