Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bypass logcontext validity check #10401

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Build/BackEnd/Components/Logging/TargetLoggingContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ internal ProjectTargetInstance Target
/// </summary>
internal void LogTargetBatchFinished(string projectFullPath, bool success, IEnumerable<TaskItem> targetOutputs)
{
ErrorUtilities.VerifyThrow(IsValid, "Should be valid");
this.CheckValidity();

TargetOutputItemsInstanceEnumeratorProxy targetOutputWrapper = null;

Expand All @@ -110,7 +110,7 @@ internal void LogTargetBatchFinished(string projectFullPath, bool success, IEnum
/// </summary>
internal TaskLoggingContext LogTaskBatchStarted(string projectFullPath, ProjectTargetInstanceChild task, string taskAssemblyLocation)
{
ErrorUtilities.VerifyThrow(IsValid, "Should be valid");
this.CheckValidity();

return new TaskLoggingContext(this, projectFullPath, task, taskAssemblyLocation);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ private void CurrentDomainOnAssemblyLoad(object? sender, AssemblyLoadEventArgs a
if (_loggingContext?.BuildEventContext != null)
{
buildArgs.BuildEventContext = _loggingContext.BuildEventContext;
_loggingContext.LogBuildEvent(buildArgs);
// bypass the logging context validity check
JanKrivanek marked this conversation as resolved.
Show resolved Hide resolved
_loggingContext.LoggingService.LogBuildEvent(buildArgs);
}
_loggingService?.LogBuildEvent(buildArgs);
}
Expand Down