@@ -104,7 +104,6 @@ use kdl::{KdlDocument, KdlNode, KdlValue};
104104use miette:: { IntoDiagnostic , Result } ;
105105use oro_config:: { OroConfig , OroConfigLayerExt , OroConfigOptions } ;
106106use tracing_appender:: non_blocking:: WorkerGuard ;
107- use tracing_indicatif:: IndicatifLayer ;
108107use tracing_subscriber:: {
109108 EnvFilter ,
110109 filter:: { Directive , LevelFilter , Targets } ,
@@ -113,6 +112,9 @@ use tracing_subscriber::{
113112} ;
114113use url:: Url ;
115114
115+ #[ cfg( feature = "tracing" ) ]
116+ use tracing_indicatif:: IndicatifLayer ;
117+
116118use commands:: OroCommand ;
117119
118120pub use error:: OroError ;
@@ -311,6 +313,12 @@ pub struct Orogene {
311313}
312314
313315impl Orogene {
316+ #[ cfg( not( feature = "tracing" ) ) ]
317+ fn setup_logging ( & self , _log_file : Option < & Path > ) -> Result < Option < WorkerGuard > > {
318+ Ok ( None )
319+ }
320+
321+ #[ cfg( feature = "tracing" ) ]
314322 fn setup_logging ( & self , log_file : Option < & Path > ) -> Result < Option < WorkerGuard > > {
315323 let builder = EnvFilter :: builder ( ) ;
316324 let filter = if self . quiet {
@@ -751,6 +759,8 @@ impl Orogene {
751759 . clone ( )
752760 . or_else ( || config. get :: < String > ( "cache" ) . ok ( ) . map ( PathBuf :: from) )
753761 . map ( |c| c. join ( "_logs" ) . join ( log_file_name ( ) ) ) ;
762+
763+ #[ cfg( feature = "tracing" ) ]
754764 let _logging_guard = oro. setup_logging ( log_file. as_deref ( ) ) ?;
755765 oro. first_time_setup ( ) ?;
756766 #[ cfg( feature = "error-reporting" ) ]
0 commit comments