8686//! [our contribution guide]: https://orogene.dev/CONTRIBUTING/
8787//! [Apache 2.0 License]: https://github.com/orogene/orogene/blob/main/LICENSE
8888
89+ #[ cfg( feature = "error-reporting" ) ]
90+ use std:: { borrow:: Cow , panic:: PanicInfo , sync:: Arc } ;
8991use std:: {
90- borrow:: Cow ,
9192 collections:: VecDeque ,
9293 ffi:: OsString ,
93- panic:: PanicInfo ,
9494 path:: { Path , PathBuf } ,
95- sync:: Arc ,
9695} ;
9796
9897use async_trait:: async_trait;
@@ -598,6 +597,7 @@ impl Orogene {
598597 . into_diagnostic ( )
599598 }
600599
600+ #[ cfg( feature = "error-reporting" ) ]
601601 fn setup_telemetry (
602602 & self ,
603603 log_file : Option < PathBuf > ,
@@ -700,6 +700,7 @@ impl Orogene {
700700 . map ( |c| c. join ( "_logs" ) . join ( log_file_name ( ) ) ) ;
701701 let _logging_guard = oro. setup_logging ( log_file. as_deref ( ) ) ?;
702702 oro. first_time_setup ( ) ?;
703+ #[ cfg( feature = "error-reporting" ) ]
703704 let _telemetry_guard = oro. setup_telemetry ( log_file. clone ( ) ) ?;
704705 let do_term_progress = !oro. quiet && oro. progress ;
705706 if do_term_progress {
@@ -723,6 +724,7 @@ impl Orogene {
723724 tracing:: debug!( "{e:?}" ) ;
724725 if let Some ( log_file) = log_file. as_deref ( ) {
725726 tracing:: warn!( "A debug log was written to {}" , log_file. display( ) ) ;
727+ #[ cfg( feature = "error-reporting" ) ]
726728 sentry:: configure_scope ( |s| {
727729 s. add_attachment ( sentry:: protocol:: Attachment {
728730 filename : log_file
@@ -735,7 +737,9 @@ impl Orogene {
735737 } ) ;
736738 } ) ;
737739 }
740+ #[ cfg( feature = "error-reporting" ) ]
738741 let dyn_err: & dyn std:: error:: Error = e. as_ref ( ) ;
742+ #[ cfg( feature = "error-reporting" ) ]
739743 sentry:: capture_error ( dyn_err) ;
740744 e
741745 } ) ?;
0 commit comments