mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-14 16:35:01 +01:00
more tests
This commit is contained in:
parent
75108c8553
commit
4f4afa627d
7 changed files with 69 additions and 24 deletions
23
src/main.rs
23
src/main.rs
|
|
@ -1,29 +1,12 @@
|
|||
use anyhow::Result;
|
||||
use cargo_minimize::{Cargo, Parser};
|
||||
use tracing::{error, info, Level};
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Registry};
|
||||
use tracing::error;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
fn main() {
|
||||
let Cargo::Minimize(options) = Cargo::parse();
|
||||
|
||||
let registry = Registry::default().with(
|
||||
EnvFilter::builder()
|
||||
.with_default_directive(Level::INFO.into())
|
||||
.from_env()
|
||||
.unwrap(),
|
||||
);
|
||||
|
||||
info!("Starting cargo-minimize");
|
||||
|
||||
let tree_layer = tracing_tree::HierarchicalLayer::new(2)
|
||||
.with_targets(true)
|
||||
.with_bracketed_fields(true);
|
||||
|
||||
registry.with(tree_layer).init();
|
||||
cargo_minimize::init_recommended_tracing_subscriber();
|
||||
|
||||
if let Err(err) = cargo_minimize::minimize(options) {
|
||||
error!("An error occured:\n{err}");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue