@@ -74,6 +74,7 @@ pub struct CommandFingerprint {
74
74
args : Vec < OsString > ,
75
75
envs : Vec < ( OsString , Option < OsString > ) > ,
76
76
cwd : Option < PathBuf > ,
77
+ short_cmd : String ,
77
78
}
78
79
79
80
#[ derive( Default , Clone ) ]
@@ -118,7 +119,7 @@ impl CommandProfiler {
118
119
let stats = self . stats . lock ( ) . unwrap ( ) ;
119
120
120
121
for ( key, profile) in stats. iter ( ) {
121
- writeln ! ( writer, "Command: {:?}" , key. program ) . unwrap ( ) ;
122
+ writeln ! ( writer, "Command: {:?}" , key. short_cmd ) . unwrap ( ) ;
122
123
123
124
let mut hits = 0 ;
124
125
let mut runs = 0 ;
@@ -350,6 +351,7 @@ impl<'a> BootstrapCommand {
350
351
. map ( |( k, v) | ( k. to_os_string ( ) , v. map ( |val| val. to_os_string ( ) ) ) )
351
352
. collect ( ) ,
352
353
cwd : command. get_current_dir ( ) . map ( Path :: to_path_buf) ,
354
+ short_cmd : command. format_short_cmd ( ) ,
353
355
}
354
356
}
355
357
}
@@ -495,19 +497,16 @@ impl Default for CommandOutput {
495
497
496
498
/// Helper trait to format both Command and BootstrapCommand as a short execution line,
497
499
/// without all the other details (e.g. environment variables).
498
- #[ cfg( feature = "tracing" ) ]
499
500
pub trait FormatShortCmd {
500
501
fn format_short_cmd ( & self ) -> String ;
501
502
}
502
503
503
- #[ cfg( feature = "tracing" ) ]
504
504
impl FormatShortCmd for BootstrapCommand {
505
505
fn format_short_cmd ( & self ) -> String {
506
506
self . command . format_short_cmd ( )
507
507
}
508
508
}
509
509
510
- #[ cfg( feature = "tracing" ) ]
511
510
impl FormatShortCmd for Command {
512
511
fn format_short_cmd ( & self ) -> String {
513
512
let program = Path :: new ( self . get_program ( ) ) ;
0 commit comments