2 instantiations of LogEntry
Aspire.Hosting (2)
src\Shared\ConsoleLogs\LogEntry.cs (2)
77return new LogEntry 99return new LogEntry
77 references to LogEntry
Aspire.Hosting (55)
ApplicationModel\ResourceLoggerService.cs (25)
391internal void AddLogEntries(string resourceName, IReadOnlyList<LogEntry> logEntries, bool inMemorySource, bool skipExisting) 413private readonly CircularBuffer<LogEntry> _inMemoryEntries = new(MaxLogCount); 466List<LogEntry> inMemoryEntries; 490var channel = Channel.CreateUnbounded<LogEntry>(); 495void Log(LogEntry log) => channel.Writer.TryWrite(log); 497LogEntry[] backlogSnapshot; 506foreach (var logEntry in _inMemoryEntries) 557var pendingLiveEntries = new List<LogEntry>(); 559void Log(LogEntry log) 582LogEntry[] backlogSnapshot; 591foreach (var logEntry in _inMemoryEntries) 673private Action<LogEntry>? _onNewLog; 674private event Action<LogEntry> OnNewLog 736internal LogEntry[] GetBacklogSnapshot() 744public void AddLog(LogEntry logEntry, bool inMemorySource) 766public void AddLogs(IReadOnlyList<LogEntry> logEntries, bool inMemorySource, bool skipExisting) 773List<LogEntry>? addedEntries = null; 790foreach (var existingEntry in existingEntries) 796foreach (var logEntry in logEntries) 833foreach (var logEntry in addedEntries) 845private sealed class Subscription(ResourceLoggerState loggerState, Action<LogEntry> log) : IDisposable 875loggerState.AddLog(LogEntry.Create(logTime, logMessage, isErrorMessage), inMemorySource: true); 880private static LogLine[] CreateLogLines(ref int lineNumber, IReadOnlyList<LogEntry> entries) 885var entry = entries[i]; 927public IAsyncEnumerable<IReadOnlyList<LogEntry>> GetAllLogsAsync(string resourceName, CancellationToken cancellationToken)
Dcp\DcpResourceWatcher.cs (12)
482var logEntries = new List<LogEntry>(); 600public async IAsyncEnumerable<IReadOnlyList<LogEntry>> GetAllLogsAsync(string resourceName, [EnumeratorCancellation] CancellationToken cancellationToken) 620var logs = new List<LogEntry>(); 621foreach (var logEntry in CreateLogEntries(batch)) 631private static IEnumerable<LogEntry> CreateLogEntries(IReadOnlyList<ResourceLogEntry> batch) 644yield return LogEntry.Create(timestamp, resolvedContent, entry.RawContent ?? entry.Content, entry.IsErrorMessage, resourcePrefix: null); 754private void SetPendingFollowLogDeduplication(string resourceName, string? resourceUid, IReadOnlyList<LogEntry> flushedLogEntries) 778foreach (var logEntry in flushedLogEntries) 815private List<LogEntry> DeduplicateFollowBatch(string resourceName, LogStreamState logStream, List<LogEntry> logEntries) 827List<LogEntry>? addedEntries = null; 828foreach (var logEntry in logEntries)
IConsoleLogsService.cs (1)
10IAsyncEnumerable<IReadOnlyList<LogEntry>> GetAllLogsAsync(string resourceName, CancellationToken cancellationToken);
src\Shared\ConsoleLogs\LogEntries.cs (13)
19private readonly CircularBuffer<LogEntry> _logEntries = new(maximumEntryCount); 27public IList<LogEntry> GetEntries() => _logEntries; 45foreach (var pauseEntry in pauseEntries) 60public bool ProcessPauseFilters(LogEntry logEntry) 90public void InsertSortedRange(IReadOnlyList<LogEntry> logEntries) 94foreach (var logEntry in logEntries) 107var merged = new List<LogEntry>(existing.Count + batch.Count); 136private bool CanMerge(IReadOnlyList<LogEntry> logEntries) 146foreach (var logEntry in logEntries) 161foreach (var existingEntry in _logEntries) 176public void InsertSorted(LogEntry logLine) 219private int InsertSortedCore(LogEntry logEntry) 230var current = _logEntries[rowIndex];
src\Shared\ConsoleLogs\LogEntry.cs (4)
75public static LogEntry CreatePause(string resourcePrefix, DateTime startTimestamp, DateTime? endTimestamp = null) 92public static LogEntry Create(DateTime? timestamp, string logMessage, bool isErrorMessage) 97public static LogEntry Create(DateTime? timestamp, string logMessage, string rawLogContent, bool isErrorMessage, string? resourcePrefix) 123public static LogEntryKey Create(LogEntry logEntry)
Aspire.Hosting.Dotnet.Tests (6)
DotnetProjectBuildCoordinatorTests.cs (6)
2221var output = Channel.CreateUnbounded<IReadOnlyList<LogEntry>>(); 2222output.Writer.TryWrite([LogEntry.Create(timestamp: null, error, isErrorMessage: false)]); 2280var firstOutput = Channel.CreateUnbounded<IReadOnlyList<LogEntry>>(); 2281firstOutput.Writer.TryWrite([LogEntry.Create(timestamp: null, firstError, isErrorMessage: false)]); 2413var channel = Channel.CreateUnbounded<IReadOnlyList<LogEntry>>(); 2417channel.Writer.TryWrite([.. lines.Select(line => LogEntry.Create(timestamp: null, line, isErrorMessage: false))]);
Aspire.Hosting.Tests (13)
Dashboard\DashboardEventHandlersTests.cs (3)
62dashboardLoggerState.AddLog(LogEntry.Create(timestamp, logMessage, isErrorMessage: false), inMemorySource: true); 118dashboardLoggerState.AddLog(LogEntry.Create(timestamp, messageJson, isErrorMessage: false), inMemorySource: true); 133dashboardLoggerState.AddLog(LogEntry.Create(timestamp, sentinelJson, isErrorMessage: false), inMemorySource: true);
Dashboard\DashboardServiceTests.cs (2)
45var getConsoleLogsChannel = Channel.CreateUnbounded<IReadOnlyList<LogEntry>>(); 85await getConsoleLogsChannel.Writer.WriteAsync([LogEntry.Create(null, "Test3", isErrorMessage: false)]);
ResourceLoggerServiceTests.cs (8)
263var consoleLogsChannel0 = Channel.CreateUnbounded<IReadOnlyList<LogEntry>>(); 264consoleLogsChannel0.Writer.TryWrite([LogEntry.Create(timestamp: null, logMessage: "instance0!", isErrorMessage: false)]); 267var consoleLogsChannel1 = Channel.CreateUnbounded<IReadOnlyList<LogEntry>>(); 268consoleLogsChannel1.Writer.TryWrite([LogEntry.Create(timestamp: null, logMessage: "instance1!", isErrorMessage: false)]); 482var consoleLogsChannel = Channel.CreateUnbounded<IReadOnlyList<LogEntry>>(); 852private static LogEntry CreateLogEntry(string content) 854return LogEntry.Create(timestamp: null, content, isErrorMessage: false); 857private static LogEntry CreateConcurrentLogEntry(int producerIndex, int entryIndex)
Aspire.Hosting.TestUtilities (3)
Utils\TestConsoleLogsService.cs (3)
12private readonly Func<string, Channel<IReadOnlyList<LogEntry>>>? _getConsoleLogsChannel; 14public TestConsoleLogsService(Func<string, Channel<IReadOnlyList<LogEntry>>>? getConsoleLogsChannel = null) 19public async IAsyncEnumerable<IReadOnlyList<LogEntry>> GetAllLogsAsync(string resourceName, [EnumeratorCancellation] CancellationToken cancellationToken)