Skip to content

Commit

Permalink
Improve log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tamasvajk committed Apr 17, 2024
1 parent 5a5fc79 commit bef556e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ private static HashSet<DotNetVersion> ParseSdks(IList<string> listed)
}

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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,17 @@ protected override IEnumerable<string> Run()
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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public IEnumerable<string> RunSourceGenerator(IEnumerable<string> additionalFile

try
{
logger.LogInfo("Produce analyzer config content.");
logger.LogInfo("Producing analyzer config content.");
GenerateAnalyzerConfig(additionalFiles, analyzerConfig);

logger.LogDebug($"Analyzer config content: {File.ReadAllText(analyzerConfig)}");
Expand Down

0 comments on commit bef556e

Please sign in to comment.