@@ -31,6 +31,7 @@ pub use progress::WorkInfo;
3131use source_query:: QueryResult ;
3232pub use source_query:: SourceQuery ;
3333pub use source_ref:: SourceRef ;
34+ use crate :: progress:: WorkGuard ;
3435
3536#[ derive( Error , Debug , Diagnostic , Clone ) ]
3637pub enum LogError {
@@ -161,6 +162,7 @@ impl LogMatcher {
161162 pub fn extract_log_statements ( & mut self , tracker : & ProgressTracker ) {
162163 tracker. begin_step ( "Extracting log statements" . to_string ( ) ) ;
163164 self . roots . iter_mut ( ) . for_each ( |( _path, coll) | {
165+ let guard = tracker. doing_work ( coll. tree . stats ( ) . files as u64 , "files" . to_string ( ) ) ;
164166 for event_chunk in & coll. tree . scan ( ) . chunks ( 10 ) {
165167 let sources = event_chunk
166168 . flat_map ( |event| match event {
@@ -179,7 +181,7 @@ impl LogMatcher {
179181 }
180182 } )
181183 . collect :: < Vec < CodeSource > > ( ) ;
182- extract_logging ( & sources, tracker )
184+ extract_logging_guarded ( & sources, & guard )
183185 . into_iter ( )
184186 . for_each ( |sif| {
185187 coll. files_with_statements . insert ( sif. id , sif) ;
@@ -489,8 +491,7 @@ where
489491 . collect ( )
490492}
491493
492- pub fn extract_logging ( sources : & [ CodeSource ] , tracker : & ProgressTracker ) -> Vec < StatementsInFile > {
493- let guard = tracker. doing_work ( sources. len ( ) as u64 , "files" . to_string ( ) ) ;
494+ pub fn extract_logging_guarded ( sources : & [ CodeSource ] , guard : & WorkGuard ) -> Vec < StatementsInFile > {
494495 sources
495496 . par_iter ( )
496497 . flat_map ( |code| {
@@ -548,6 +549,11 @@ pub fn extract_logging(sources: &[CodeSource], tracker: &ProgressTracker) -> Vec
548549 . collect ( )
549550}
550551
552+ pub fn extract_logging ( sources : & [ CodeSource ] , tracker : & ProgressTracker ) -> Vec < StatementsInFile > {
553+ let guard = tracker. doing_work ( sources. len ( ) as u64 , "files" . to_string ( ) ) ;
554+ extract_logging_guarded ( sources, & guard)
555+ }
556+
551557#[ cfg( test) ]
552558mod tests {
553559 use super :: * ;
0 commit comments