Skip to content

Commit

Permalink
C#: Replace some LogInfo with LogDebug.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnebel committed Apr 12, 2024
1 parent 88e5b77 commit 03e00a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private void AddReferenceDirectory(List<string> dllsToIndex, ILogger logger)
}
else
{
logger.LogInfo($"AssemblyLookupLocation: Skipping {dll.FullName}.");
logger.LogDebug($"AssemblyLookupLocation: Skipping {dll.FullName}.");
}
}
}
Expand All @@ -68,19 +68,19 @@ public List<string> GetDlls(ILogger logger)
}
else
{
logger.LogInfo($"AssemblyLookupLocation: Skipping {path}.");
logger.LogDebug($"AssemblyLookupLocation: Skipping {path}.");
}
return dllsToIndex;
}

if (Directory.Exists(path))
{
logger.LogInfo($"AssemblyLookupLocation: Finding reference DLLs in {path}...");
logger.LogDebug($"AssemblyLookupLocation: Finding reference DLLs in {path}...");
AddReferenceDirectory(dllsToIndex, logger);
}
else
{
logger.LogInfo("AssemblyLookupLocation: Path not found: " + path);
logger.LogDebug("AssemblyLookupLocation: Path not found: " + path);
}
return dllsToIndex;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ private void LogAllUnusedPackages(DependencyContainer dependencies)
allPackageDirectories
.Where(package => !dependencies.Packages.Contains(package))
.Order()
.ForEach(package => logger.LogInfo($"Unused package: {package}"));
.ForEach(package => logger.LogDebug($"Unused package: {package}"));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ void exitCallback(int ret, string msg, bool silent)
// Output the findings
foreach (var r in usedReferences.Keys.OrderBy(r => r))
{
logger.LogInfo($"Resolved reference {r}");
logger.LogDebug($"Resolved reference {r}");
}

foreach (var r in unresolvedReferences.OrderBy(r => r.Key))
{
logger.LogInfo($"Unresolved reference {r.Key} in project {r.Value}");
logger.LogDebug($"Unresolved reference {r.Key} in project {r.Value}");
}

var webViewExtractionOption = Environment.GetEnvironmentVariable(EnvironmentVariableNames.WebViewGeneration);
Expand Down Expand Up @@ -256,7 +256,7 @@ private void RemoveNugetAnalyzerReferences()
if (isInAnalyzersFolder)
{
usedReferences.Remove(filename);
logger.LogInfo($"Removed analyzer reference {filename}");
logger.LogDebug($"Removed analyzer reference {filename}");
}
}
}
Expand All @@ -268,19 +268,19 @@ private void SelectNewestFrameworkPath(string frameworkPath, string frameworkTyp
if (versionFolders.Length > 1)
{
var versions = string.Join(", ", versionFolders.Select(d => d.Name));
logger.LogInfo($"Found multiple {frameworkType} DLLs in NuGet packages at {frameworkPath}. Using the latest version ({versionFolders[0].Name}) from: {versions}.");
logger.LogDebug($"Found multiple {frameworkType} DLLs in NuGet packages at {frameworkPath}. Using the latest version ({versionFolders[0].Name}) from: {versions}.");
}

var selectedFrameworkFolder = versionFolders.FirstOrDefault()?.FullName;
if (selectedFrameworkFolder is null)
{
logger.LogInfo($"Found {frameworkType} DLLs in NuGet packages at {frameworkPath}, but no version folder was found.");
logger.LogDebug($"Found {frameworkType} DLLs in NuGet packages at {frameworkPath}, but no version folder was found.");
selectedFrameworkFolder = frameworkPath;
}

dllLocations.Add(selectedFrameworkFolder);
frameworkLocations.Add(selectedFrameworkFolder);
logger.LogInfo($"Found {frameworkType} DLLs in NuGet packages at {selectedFrameworkFolder}.");
logger.LogDebug($"Found {frameworkType} DLLs in NuGet packages at {selectedFrameworkFolder}.");
}

private static DirectoryInfo[] GetPackageVersionSubDirectories(string packagePath)
Expand Down Expand Up @@ -373,7 +373,7 @@ private void RemoveNugetPackageReference(string packagePrefix, ISet<AssemblyLook
foreach (var path in toRemove)
{
dllLocations.Remove(path);
logger.LogInfo($"Removed reference {path}");
logger.LogDebug($"Removed reference {path}");
}
}

Expand Down Expand Up @@ -616,7 +616,7 @@ private void ResolveConflicts(IEnumerable<string> frameworkPaths)
if (resolvedInfo.Version != r.Version || resolvedInfo.NetCoreVersion != r.NetCoreVersion)
{
var asm = resolvedInfo.Id + (resolvedInfo.NetCoreVersion is null ? "" : $" (.NET Core {resolvedInfo.NetCoreVersion})");
logger.LogInfo($"Resolved {r.Id} as {asm}");
logger.LogDebug($"Resolved {r.Id} as {asm}");

++conflictedReferences;
}
Expand Down

0 comments on commit 03e00a2

Please sign in to comment.