Skip to content

Commit cb5a682

Browse files
committed
C#: Add some logging related to project file content.
1 parent 02cf0c6 commit cb5a682

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,14 @@ private void DoInitialize()
240240
logger.LogDebug($"Failed to read file {file}, exception: {ex}");
241241
}
242242
}
243+
244+
logger.LogInfo("Finished reading project files.");
245+
logger.LogInfo($"Legacy project structure usage detected: {isLegacyProjectStructureUsed}");
246+
logger.LogInfo($"New project structure usage detected: {isNewProjectStructureUsed}");
247+
logger.LogInfo($"ASP.NET usage detected: {useAspNetCoreDlls}");
248+
logger.LogInfo($"Windows Forms usage detected: {useWindowsForms}");
249+
logger.LogInfo($"WPF usage detected: {useWpf}");
250+
logger.LogInfo($"Implicit usings enabled: {useImplicitUsings}");
243251
}
244252

245253
[GeneratedRegex("(?<!<!--.*)<PackageReference.*\\sInclude=\"(.*?)\".*/?>", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline)]

‎csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public HashSet<AssemblyLookupLocation> Restore()
149149
.ToList();
150150

151151

152-
logger.LogInfo($"Restored {nugetPackageDllPaths.Count} NuGet DLLs.");
152+
logger.LogInfo($"Restored {nugetPackageDllPaths.Count} NuGet DLLs from packages.config files using the NuGet CLI.");
153153

154154
if (excludedPaths.Count > 0)
155155
{
@@ -163,7 +163,7 @@ public HashSet<AssemblyLookupLocation> Restore()
163163

164164
nugetPackageDllPaths.ExceptWith(excludedPaths);
165165

166-
logger.LogInfo($"Using {nugetPackageDllPaths.Count} NuGet DLLs as dependency candidates.");
166+
logger.LogInfo($"Using {nugetPackageDllPaths.Count} DLLs as dependency candidates from NuGet packages restored via the NuGet CLI based on packages.config files.");
167167
foreach (var path in nugetPackageDllPaths)
168168
{
169169
logger.LogDebug($"Using NuGet DLL as dependency candidate: {path}");

0 commit comments

Comments
 (0)