Skip to content

Commit

Permalink
Setup tracing_subscriber before anything else (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorenesduarte committed Mar 30, 2021
1 parent 494699e commit 98ad924
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions modelator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,6 @@ where
}

pub(crate) fn setup(options: &Options) -> Result<(), Error> {
// create modelator dir (if it doens't already exist)
if !options.dir.as_path().is_dir() {
std::fs::create_dir_all(&options.dir).map_err(Error::io)?;
}

// download missing jars
jar::download_jars(&options.dir)?;
tracing::trace!("modelator setup completed");

// init tracing subscriber (in case it's not already)
if let Err(e) = tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
Expand All @@ -112,5 +103,14 @@ pub(crate) fn setup(options: &Options) -> Result<(), Error> {
);
}

// create modelator dir (if it doens't already exist)
if !options.dir.as_path().is_dir() {
std::fs::create_dir_all(&options.dir).map_err(Error::io)?;
}

// download missing jars
jar::download_jars(&options.dir)?;
tracing::trace!("modelator setup completed");

Ok(())
}

0 comments on commit 98ad924

Please sign in to comment.