File: Logging\FakeLogCollectorDebugView.cs
Web Access
Project: src\src\Libraries\Microsoft.Extensions.Diagnostics.Testing\Microsoft.Extensions.Diagnostics.Testing.csproj (Microsoft.Extensions.Diagnostics.Testing)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Shared.Diagnostics;
 
namespace Microsoft.Extensions.Logging.Testing;
 
[ExcludeFromCodeCoverage/* (Justification = "Only used in debugger") */]
internal sealed class FakeLogCollectorDebugView
{
    private readonly FakeLogCollector _collector;
 
    public FakeLogCollectorDebugView(FakeLogCollector collector)
    {
        _collector = Throw.IfNull(collector);
    }
 
    [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
    public IReadOnlyList<FakeLogRecord> Records => _collector.GetSnapshot();
}