Skip to content

Commit

Permalink
Set up logging in handle_model
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Sep 7, 2023
1 parent 25bed50 commit 4b2a75a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/fj/src/handle_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use fj_core::{
};
use fj_interop::model::Model;
use fj_math::{Aabb, Point, Scalar};
use tracing_subscriber::prelude::*;

use crate::Args;

Expand All @@ -30,6 +31,11 @@ where
for<'r> (&'r M, Tolerance): Triangulate,
M: BoundingVolume<3>,
{
tracing_subscriber::registry()
.with(tracing_subscriber::fmt::layer())
.with(tracing_subscriber::EnvFilter::from_default_env())
.init();

let args = Args::parse();

if args.ignore_validation {
Expand Down Expand Up @@ -82,6 +88,10 @@ pub type Result = std::result::Result<(), Error>;
/// Error returned by [`handle_model`]
#[derive(thiserror::Error)]
pub enum Error {
/// Failed to set up logger
#[error("Failed to set up logger")]
Tracing(#[from] tracing::subscriber::SetGlobalDefaultError),

/// Error displaying model
#[error("Error displaying model")]
Display(#[from] crate::window::Error),
Expand Down

0 comments on commit 4b2a75a

Please sign in to comment.