Skip to content

Commit dadf67d

Browse files
committed
C#: Address review comments related to logging.
1 parent b2e83bb commit dadf67d

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,19 @@ private DependabotProxy(IDependabotProxyConfiguration config, ILogger logger, Te
9797
{
9898
if (string.IsNullOrWhiteSpace(registry.Url))
9999
{
100-
logger.LogDebug("Ignoring registry with empty URL.");
100+
logger.LogError("Ignoring registry with empty URL.");
101+
continue;
102+
}
103+
104+
if (string.IsNullOrWhiteSpace(registry.Type))
105+
{
106+
logger.LogError($"Ignoring registry at '{registry.Url}' since it has no type.");
101107
continue;
102108
}
103109

104110
// The array contains all configured private registries, not just ones for C#.
105111
// We ignore the non-C# ones here.
106-
if (registry.Type is null || !registry.Type.Equals("nuget_feed"))
112+
if (!registry.Type.Equals("nuget_feed"))
107113
{
108114
logger.LogDebug($"Ignoring registry at '{registry.Url}' since it is not of type 'nuget_feed'.");
109115
continue;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ private List<string> GetReachableFallbackNugetFeeds()
359359
logger.LogInfo($"Using NuGet feeds from nuget.config files as fallback feeds: {string.Join(", ", ExplicitFeeds.OrderBy(f => f))}");
360360
}
361361
}
362+
else
363+
{
364+
logger.LogInfo($"Using fallback NuGet feeds from environment variable '{EnvironmentVariableNames.FallbackNugetFeeds}'.");
365+
}
362366

363367
return GetReachableNuGetFeeds(fallbackFeeds, isFallback: true);
364368
}

0 commit comments

Comments
 (0)