Skip to content

[5752] FakeLogCollector waiting capabilities#6228

Merged
Demo30 merged 52 commits intodotnet:mainfrom
Demo30:twiesner/5752_FakeLogCollector_waiting_differentDesign
Jan 21, 2026
Merged

[5752] FakeLogCollector waiting capabilities#6228
Demo30 merged 52 commits intodotnet:mainfrom
Demo30:twiesner/5752_FakeLogCollector_waiting_differentDesign

Conversation

@Demo30
Copy link
Contributor

@Demo30 Demo30 commented Apr 2, 2025

Microsoft Reviewers: Open in CodeFlow

PR Description

  • This PR tackles issue [API Proposal]: Extend FakeLogCollector with waiting capabilities #5752.
  • It adds support for asynchronously streaming new logs to the caller via added method IAsyncEnumerable<FakeLogRecord> GetLogsAsync(CancellationToken cancellationToken = default).
  • This method enables the caller to asynchronously await a log (or custom-defined sequence of logs) without the need to resort to GetSnapshot/polling approach.
  • When leveraging library such as System.Linq.Async the caller is enabled to await the logs using elegant syntax such as: var myLogs = await fakeLogCollector.GetLogsAsync(ct).Where(log => log.Category == "x").Take(3).ToListAsync();

@Demo30 Demo30 self-assigned this Apr 2, 2025
Tomáš Wiesner added 7 commits May 20, 2025 15:47
…752_FakeLogCollector_waiting_differentDesign

# Conflicts:
#	src/Libraries/Microsoft.Extensions.Diagnostics.Testing/Logging/FakeLogCollector.cs
@Demo30 Demo30 added the * NO MERGE * Do not merge this PR as long as this label is present. label Aug 21, 2025
This was referenced Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Extend FakeLogCollector with waiting capabilities

3 participants