Skip to content

Avoid collecting logs in buffer if a pipeline execution event is not going to be logged#15350

Merged
anmenaga merged 3 commits into
PowerShell:masterfrom
daxian-dbw:logbuffer
May 10, 2021
Merged

Avoid collecting logs in buffer if a pipeline execution event is not going to be logged#15350
anmenaga merged 3 commits into
PowerShell:masterfrom
daxian-dbw:logbuffer

Conversation

@daxian-dbw
Copy link
Copy Markdown
Member

PR Summary

A partial fix for #15341

The pipeline execution does a lot loggings. Today, we collect all the log strings in a buffer, and if the group policy EnableModuleLogging is enabled, strings from that buffer will be concatenated and used as the payload for writing out a pipeline execution-details event.

The thing is, in most cases, the group policy EnableModuleLogging is NOT enabled, and we are just collecting a lot logging strings in a buffer list in vain. This PR makes changes to avoid collecting logs when we are not going to log the pipeline execution-details event.

PR Checklist

Comment thread src/System.Management.Automation/engine/pipeline.cs Outdated
Comment thread src/System.Management.Automation/engine/pipeline.cs
Copy link
Copy Markdown
Collaborator

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good to me. Having read through the discussions, I think the latest changes reflect the outcome of those discussions and agree with where the code stands now.

Comment thread src/System.Management.Automation/engine/pipeline.cs
Comment thread src/System.Management.Automation/engine/pipeline.cs
@anmenaga anmenaga added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label May 10, 2021
@anmenaga anmenaga merged commit b16dac7 into PowerShell:master May 10, 2021
@daxian-dbw daxian-dbw deleted the logbuffer branch May 11, 2021 20:47
@daxian-dbw daxian-dbw added CL-Performance Indicates that a PR should be marked as a performance improvement in the Change Log and removed CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log labels May 11, 2021
@ghost
Copy link
Copy Markdown

ghost commented May 27, 2021

🎉v7.2.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Performance Indicates that a PR should be marked as a performance improvement in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants