8787//! [Apache 2.0 License]: https://github.com/orogene/orogene/blob/main/LICENSE
8888
8989use std:: {
90- borrow:: Cow ,
9190 collections:: VecDeque ,
9291 ffi:: OsString ,
93- panic:: PanicInfo ,
9492 path:: { Path , PathBuf } ,
93+ } ;
94+ #[ cfg( feature = "error-reporting" ) ]
95+ use std:: {
96+ borrow:: Cow ,
97+ panic:: PanicInfo ,
9598 sync:: Arc ,
9699} ;
97100
@@ -598,6 +601,7 @@ impl Orogene {
598601 . into_diagnostic ( )
599602 }
600603
604+ #[ cfg( feature = "error-reporting" ) ]
601605 fn setup_telemetry (
602606 & self ,
603607 log_file : Option < PathBuf > ,
@@ -700,6 +704,7 @@ impl Orogene {
700704 . map ( |c| c. join ( "_logs" ) . join ( log_file_name ( ) ) ) ;
701705 let _logging_guard = oro. setup_logging ( log_file. as_deref ( ) ) ?;
702706 oro. first_time_setup ( ) ?;
707+ #[ cfg( feature = "error-reporting" ) ]
703708 let _telemetry_guard = oro. setup_telemetry ( log_file. clone ( ) ) ?;
704709 let do_term_progress = !oro. quiet && oro. progress ;
705710 if do_term_progress {
@@ -723,6 +728,7 @@ impl Orogene {
723728 tracing:: debug!( "{e:?}" ) ;
724729 if let Some ( log_file) = log_file. as_deref ( ) {
725730 tracing:: warn!( "A debug log was written to {}" , log_file. display( ) ) ;
731+ #[ cfg( feature = "error-reporting" ) ]
726732 sentry:: configure_scope ( |s| {
727733 s. add_attachment ( sentry:: protocol:: Attachment {
728734 filename : log_file
@@ -735,7 +741,9 @@ impl Orogene {
735741 } ) ;
736742 } ) ;
737743 }
744+ #[ cfg( feature = "error-reporting" ) ]
738745 let dyn_err: & dyn std:: error:: Error = e. as_ref ( ) ;
746+ #[ cfg( feature = "error-reporting" ) ]
739747 sentry:: capture_error ( dyn_err) ;
740748 e
741749 } ) ?;
0 commit comments