Skip to content

Commit

Permalink
Don't log all injector names if there are more than 25 unused injectors
Browse files Browse the repository at this point in the history
  • Loading branch information
gamingrobot committed Aug 27, 2024
1 parent 995320b commit 25ac979
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,19 @@ private async ValueTask Handle(CancellationToken cancellationToken = default)

if (unusedInjectors.Any())
{
Logger.Info(() =>
var unusedCount = unusedInjectors.Count;
if(unusedCount >= 25)
{
var unusedInjectorsStr = string.Join(", ", unusedInjectors.Select(x => $"'{x.Identity}'"));
return $"A total of {unusedInjectors.Count} valid injectors do not match any known entities. (Unused injectors: [{unusedInjectorsStr}])";
});
Logger.Info(() => $"A total of {unusedCount} valid injectors do not match any known entities.");
}
else
{
Logger.Info(() =>
{
var unusedInjectorsStr = string.Join(", ", unusedInjectors.Select(x => $"'{x.Identity}'"));
return $"A total of {unusedCount} valid injectors do not match any known entities. (Unused injectors: [{unusedInjectorsStr}])";
});
}
}
}

Expand Down

0 comments on commit 25ac979

Please sign in to comment.