@@ -32,14 +32,14 @@ public string Identifier
3232 get { return _identifier ; }
3333 }
3434
35- public Coverage ( string module ,
36- string [ ] includeFilters ,
37- string [ ] includeDirectories ,
38- string [ ] excludeFilters ,
39- string [ ] excludedSourceFiles ,
40- string [ ] excludeAttributes ,
41- bool singleHit ,
42- string mergeWith ,
35+ public Coverage ( string module ,
36+ string [ ] includeFilters ,
37+ string [ ] includeDirectories ,
38+ string [ ] excludeFilters ,
39+ string [ ] excludedSourceFiles ,
40+ string [ ] excludeAttributes ,
41+ bool singleHit ,
42+ string mergeWith ,
4343 bool useSourceLink ,
4444 ILogger logger )
4545 {
@@ -62,16 +62,24 @@ public void PrepareModules()
6262 {
6363 string [ ] modules = InstrumentationHelper . GetCoverableModules ( _module , _includeDirectories ) ;
6464 string [ ] excludes = InstrumentationHelper . GetExcludedFiles ( _excludedSourceFiles ) ;
65+
66+ Array . ForEach ( _excludeFilters ?? Array . Empty < string > ( ) , filter => _logger . LogInformation ( $ "Excluded module filter '{ filter } '") ) ;
67+ Array . ForEach ( _includeFilters ?? Array . Empty < string > ( ) , filter => _logger . LogInformation ( $ "Included module filter '{ filter } '") ) ;
68+ Array . ForEach ( excludes ?? Array . Empty < string > ( ) , filter => _logger . LogInformation ( $ "Excluded source files '{ filter } '") ) ;
69+
6570 _excludeFilters = _excludeFilters ? . Where ( f => InstrumentationHelper . IsValidFilterExpression ( f ) ) . ToArray ( ) ;
6671 _includeFilters = _includeFilters ? . Where ( f => InstrumentationHelper . IsValidFilterExpression ( f ) ) . ToArray ( ) ;
6772
6873 foreach ( var module in modules )
6974 {
7075 if ( InstrumentationHelper . IsModuleExcluded ( module , _excludeFilters ) ||
7176 ! InstrumentationHelper . IsModuleIncluded ( module , _includeFilters ) )
77+ {
78+ _logger . LogInformation ( $ "Excluded module: '{ module } '") ;
7279 continue ;
80+ }
7381
74- var instrumenter = new Instrumenter ( module , _identifier , _excludeFilters , _includeFilters , excludes , _excludeAttributes , _singleHit ) ;
82+ var instrumenter = new Instrumenter ( module , _identifier , _excludeFilters , _includeFilters , excludes , _excludeAttributes , _singleHit , _logger ) ;
7583 if ( instrumenter . CanInstrument ( ) )
7684 {
7785 InstrumentationHelper . BackupOriginalModule ( module , _identifier ) ;
@@ -81,6 +89,7 @@ public void PrepareModules()
8189 {
8290 var result = instrumenter . Instrument ( ) ;
8391 _results . Add ( result ) ;
92+ _logger . LogInformation ( $ "Instrumented module: '{ module } '") ;
8493 }
8594 catch ( Exception ex )
8695 {
@@ -197,7 +206,7 @@ private void CalculateCoverage()
197206 {
198207 if ( ! File . Exists ( result . HitsFilePath ) )
199208 {
200- // File not instrumented, or nothing in it called. Warn about this?
209+ _logger . LogWarning ( $ "Hits file:' { result . HitsFilePath } ' not found for module: ' { result . Module } '" ) ;
201210 continue ;
202211 }
203212
0 commit comments