Skip to content

Commit

Permalink
Cleanup some log spew under RestoreTask.
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillOsenkov committed Dec 16, 2020
1 parent 7fd033f commit c0e1e7d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
44 changes: 40 additions & 4 deletions src/StructuredLogger/Construction/MessageProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@ public void AddMessage(LazyFormattedBuildEventArgs args, string message)
else if (string.Equals(task.Name, "MSBuild", StringComparison.OrdinalIgnoreCase))
{
if (message.StartsWith(Strings.GlobalPropertiesPrefix) ||
Strings.AdditionalPropertiesPrefix.IsMatch(message) ||
Strings.OverridingGlobalPropertiesPrefix.IsMatch(message) ||
message.StartsWith(Strings.RemovingPropertiesPrefix)
|| Strings.RemovingProjectProperties.IsMatch(message))
Strings.AdditionalPropertiesPrefix.IsMatch(message) ||
Strings.OverridingGlobalPropertiesPrefix.IsMatch(message) ||
message.StartsWith(Strings.RemovingPropertiesPrefix) ||
Strings.RemovingProjectProperties.IsMatch(message))
{
node.GetOrCreateNodeWithName<Folder>(message);
return;
Expand Down Expand Up @@ -360,6 +360,42 @@ public void AddMessage(LazyFormattedBuildEventArgs args, string message)
};
}
}
else if (string.Equals(task.Name, "RestoreTask"))
{
// just throw these away to save space
// https://github.com/NuGet/Home/issues/10383
if (message.StartsWith(Strings.RestoreTask_CheckingCompatibilityFor))
{
return;
}
else if (message.StartsWith(" GET"))
{
node = node.GetOrCreateNodeWithName<Folder>("GET");
}
else if (message.StartsWith(" CACHE"))
{
node = node.GetOrCreateNodeWithName<Folder>("CACHE");
}
else if (message.StartsWith(" OK"))
{
node = node.GetOrCreateNodeWithName<Folder>("OK");
}
else if (message.StartsWith(" NotFound"))
{
node = node.GetOrCreateNodeWithName<Folder>("NotFound");
}
else if (
message.StartsWith(Strings.RestoreTask_CheckingCompatibilityFor) ||
message.StartsWith(Strings.RestoreTask_CheckingCompatibilityOfPackages) ||
message.StartsWith(Strings.RestoreTask_AcquiringLockForTheInstallation) ||
message.StartsWith(Strings.RestoreTask_AcquiredLockForTheInstallation) ||
message.StartsWith(Strings.RestoreTask_CompletedInstallationOf) ||
message.StartsWith(Strings.RestoreTask_ResolvingConflictsFor)
)
{
return;
}
}
}
}
else if (args.BuildEventContext?.TargetId > 0)
Expand Down
10 changes: 10 additions & 0 deletions src/StructuredLogger/Strings/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,16 @@ public static bool IsThereWasAConflictPrefix(string message)

public static string TotalAnalyzerExecutionTime => "Total analyzer execution time:";

/// <summary>
/// https://github.com/NuGet/Home/issues/10383
/// </summary>
public static string RestoreTask_CheckingCompatibilityFor = "Checking compatibility for";
public static string RestoreTask_CheckingCompatibilityOfPackages = "Checking compatibility of packages";
public static string RestoreTask_AcquiringLockForTheInstallation = "Acquiring lock for the installation";
public static string RestoreTask_AcquiredLockForTheInstallation = "Acquired lock for the installation";
public static string RestoreTask_CompletedInstallationOf = "Completed installation of";
public static string RestoreTask_ResolvingConflictsFor = "Resolving conflicts for";

public static string Evaluation => "Evaluation";
public static string Environment => "Environment";
public static string Imports => "Imports";
Expand Down

0 comments on commit c0e1e7d

Please sign in to comment.