File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,12 @@ log = "0.4.20"
2222faccess = " 0.2.4"
2323os_pipe = " 1.1.4"
2424env_logger = " 0.10.0"
25+ build-print = { version = " 0.1.1" , optional = true }
2526
2627[dev-dependencies ]
2728rayon = " 1.8.0"
2829clap = { version = " 4" , features = [" derive" ] }
2930byte-unit = " 4.0.19"
31+
32+ [features ]
33+ build-print = [" dep:build-print" ]
Original file line number Diff line number Diff line change @@ -376,8 +376,12 @@ pub use cmd_lib_macros::{
376376pub type FunResult = std:: io:: Result < String > ;
377377/// Return type for [`run_cmd!()`] macro.
378378pub type CmdResult = std:: io:: Result < ( ) > ;
379+ #[ cfg( feature = "build-print" ) ]
380+ #[ doc( hidden) ]
381+ pub use build_print as inner_log;
379382pub use child:: { CmdChildren , FunChildren } ;
380383pub use io:: { CmdIn , CmdOut } ;
384+ #[ cfg( not( feature = "build-print" ) ) ]
381385#[ doc( hidden) ]
382386pub use log as inner_log;
383387#[ doc( hidden) ]
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ macro_rules! info {
3939macro_rules! debug {
4040 ( $( $arg: tt) * ) => { {
4141 $crate:: try_init_default_logger( ) ;
42+ #[ cfg( feature = "build-print" ) ]
43+ $crate:: inner_log:: info!( $( $arg) * ) ;
44+ #[ cfg( not( feature = "build-print" ) ) ]
4245 $crate:: inner_log:: debug!( $( $arg) * ) ;
4346 } }
4447}
@@ -48,6 +51,9 @@ macro_rules! debug {
4851macro_rules! trace {
4952 ( $( $arg: tt) * ) => { {
5053 $crate:: try_init_default_logger( ) ;
54+ #[ cfg( feature = "build-print" ) ]
55+ $crate:: inner_log:: info!( $( $arg) * ) ;
56+ #[ cfg( not( feature = "build-print" ) ) ]
5157 $crate:: inner_log:: trace!( $( $arg) * ) ;
5258 } }
5359}
You can’t perform that action at this time.
0 commit comments