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
17
src/lib.rs
17
src/lib.rs
|
|
@ -15,6 +15,8 @@ mod expand;
|
|||
use anyhow::{Context, Result};
|
||||
use dylib_flag::RustFunction;
|
||||
use processor::Minimizer;
|
||||
use tracing::Level;
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Registry};
|
||||
|
||||
use crate::processor::Processor;
|
||||
|
||||
|
|
@ -92,6 +94,21 @@ pub fn minimize(options: Options) -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn init_recommended_tracing_subscriber() {
|
||||
let registry = Registry::default().with(
|
||||
EnvFilter::builder()
|
||||
.with_default_directive(Level::INFO.into())
|
||||
.from_env()
|
||||
.unwrap(),
|
||||
);
|
||||
|
||||
let tree_layer = tracing_tree::HierarchicalLayer::new(2)
|
||||
.with_targets(true)
|
||||
.with_bracketed_fields(true);
|
||||
|
||||
registry.with(tree_layer).init();
|
||||
}
|
||||
|
||||
impl Default for Options {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue