@@ -593,6 +593,8 @@ enum CommandState<'a> {
593
593
executed_at : & ' a Location < ' a > ,
594
594
fingerprint : CommandFingerprint ,
595
595
start_time : Instant ,
596
+ #[ cfg( feature = "tracing" ) ]
597
+ _span_guard : tracing:: span:: EnteredSpan ,
596
598
} ,
597
599
}
598
600
@@ -693,6 +695,9 @@ impl ExecutionContext {
693
695
) -> DeferredCommand < ' a > {
694
696
let fingerprint = command. fingerprint ( ) ;
695
697
698
+ #[ cfg( feature = "tracing" ) ]
699
+ let span_guard = trace_cmd ! ( command) ;
700
+
696
701
if let Some ( cached_output) = self . command_cache . get ( & fingerprint) {
697
702
command. mark_as_executed ( ) ;
698
703
self . verbose ( || println ! ( "Cache hit: {command:?}" ) ) ;
@@ -713,13 +718,12 @@ impl ExecutionContext {
713
718
executed_at,
714
719
fingerprint,
715
720
start_time : Instant :: now ( ) ,
721
+ #[ cfg( feature = "tracing" ) ]
722
+ _span_guard : span_guard,
716
723
} ,
717
724
} ;
718
725
}
719
726
720
- #[ cfg( feature = "tracing" ) ]
721
- let _run_span = trace_cmd ! ( command) ;
722
-
723
727
self . verbose ( || {
724
728
println ! ( "running: {command:?} (created at {created_at}, executed at {executed_at})" )
725
729
} ) ;
@@ -741,6 +745,8 @@ impl ExecutionContext {
741
745
executed_at,
742
746
fingerprint,
743
747
start_time,
748
+ #[ cfg( feature = "tracing" ) ]
749
+ _span_guard : span_guard,
744
750
} ,
745
751
}
746
752
}
@@ -841,6 +847,7 @@ impl<'a> DeferredCommand<'a> {
841
847
executed_at,
842
848
fingerprint,
843
849
start_time,
850
+ ..
844
851
} => {
845
852
let exec_ctx = exec_ctx. as_ref ( ) ;
846
853
0 commit comments