Improve log messages

This commit is contained in:
Tamas Vajk
2024-04-17 11:40:50 +02:00
parent 5a5fc79b3b
commit bef556e208
3 changed files with 5 additions and 7 deletions

View File

@@ -63,10 +63,10 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
}
var path = Path.Combine(sdk.FullPath, "Roslyn", "bincore", "csc.dll");
logger.LogInfo($"Source generator CSC: '{path}'");
logger.LogDebug($"Source generator CSC: '{path}'");
if (!File.Exists(path))
{
logger.LogInfo($"csc.dll not found at '{path}'.");
logger.LogWarning($"csc.dll not found at '{path}'.");
return null;
}

View File

@@ -34,19 +34,17 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
var additionalFiles = AdditionalFiles;
if (additionalFiles.Count == 0)
{
logger.LogDebug($"No {FileType} files found.");
logger.LogDebug($"No {FileType} files found. Skipping source generation.");
return [];
}
logger.LogInfo($"Found {additionalFiles.Count} {FileType} files.");
if (!fileContent.IsAspNetCoreDetected)
{
logger.LogInfo($"Generating source files from {FileType} files is only supported for new (SDK-style) project files");
return [];
}
logger.LogInfo($"Generating source files from {FileType} files...");
logger.LogInfo($"Generating source files from {additionalFiles.Count} {FileType} files...");
try
{

View File

@@ -45,7 +45,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
try
{
logger.LogInfo("Produce analyzer config content.");
logger.LogInfo("Producing analyzer config content.");
GenerateAnalyzerConfig(additionalFiles, analyzerConfig);
logger.LogDebug($"Analyzer config content: {File.ReadAllText(analyzerConfig)}");