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,12 +22,16 @@ log = "0.4.20"
22
22
faccess = " 0.2.4"
23
23
os_pipe = " 1.1.4"
24
24
env_logger = " 0.10.0"
25
+ build-print = { version = " 1.0" , optional = true }
25
26
tracing = { version = " 0.1.41" , optional = true }
26
27
27
28
[dev-dependencies ]
28
29
rayon = " 1.8.0"
29
30
clap = { version = " 4" , features = [" derive" ] }
30
31
byte-unit = " 4.0.19"
32
+
33
+ [features ]
34
+ build-print = [" dep:build-print" ]
31
35
tracing = " 0.1.41"
32
36
tracing-subscriber = { version = " 0.3.19" , features = [" env-filter" ] }
33
37
Original file line number Diff line number Diff line change @@ -386,8 +386,12 @@ pub use cmd_lib_macros::{
386
386
pub type FunResult = std:: io:: Result < String > ;
387
387
/// Return type for [`run_cmd!()`] macro.
388
388
pub type CmdResult = std:: io:: Result < ( ) > ;
389
+ #[ cfg( feature = "build-print" ) ]
390
+ #[ doc( hidden) ]
391
+ pub use build_print as inner_log;
389
392
pub use child:: { CmdChildren , FunChildren } ;
390
393
pub use io:: { CmdIn , CmdOut } ;
394
+ #[ cfg( not( feature = "build-print" ) ) ]
391
395
#[ doc( hidden) ]
392
396
pub use log as inner_log;
393
397
#[ doc( hidden) ]
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ macro_rules! info {
39
39
macro_rules! debug {
40
40
( $( $arg: tt) * ) => { {
41
41
$crate:: try_init_default_logger( ) ;
42
+ #[ cfg( feature = "build-print" ) ]
43
+ $crate:: inner_log:: info!( $( $arg) * ) ;
44
+ #[ cfg( not( feature = "build-print" ) ) ]
42
45
$crate:: inner_log:: debug!( $( $arg) * ) ;
43
46
} }
44
47
}
@@ -48,6 +51,9 @@ macro_rules! debug {
48
51
macro_rules! trace {
49
52
( $( $arg: tt) * ) => { {
50
53
$crate:: try_init_default_logger( ) ;
54
+ #[ cfg( feature = "build-print" ) ]
55
+ $crate:: inner_log:: info!( $( $arg) * ) ;
56
+ #[ cfg( not( feature = "build-print" ) ) ]
51
57
$crate:: inner_log:: trace!( $( $arg) * ) ;
52
58
} }
53
59
}
You can’t perform that action at this time.
0 commit comments