2 instantiations of LogEntry
Aspire.Hosting (2)
src\Shared\ConsoleLogs\LogEntry.cs (2)
77return new LogEntry 99return new LogEntry
66 references to LogEntry
Aspire.Hosting (50)
ApplicationModel\ResourceLoggerService.cs (25)
361internal void AddLogEntries(string resourceName, IReadOnlyList<LogEntry> logEntries, bool inMemorySource, bool skipExisting) 383private readonly CircularBuffer<LogEntry> _inMemoryEntries = new(MaxLogCount); 436List<LogEntry> inMemoryEntries; 460var channel = Channel.CreateUnbounded<LogEntry>(); 465void Log(LogEntry log) => channel.Writer.TryWrite(log); 467LogEntry[] backlogSnapshot; 476foreach (var logEntry in _inMemoryEntries) 527var pendingLiveEntries = new List<LogEntry>(); 529void Log(LogEntry log) 552LogEntry[] backlogSnapshot; 561foreach (var logEntry in _inMemoryEntries) 643private Action<LogEntry>? _onNewLog; 644private event Action<LogEntry> OnNewLog 706internal LogEntry[] GetBacklogSnapshot() 714public void AddLog(LogEntry logEntry, bool inMemorySource) 736public void AddLogs(IReadOnlyList<LogEntry> logEntries, bool inMemorySource, bool skipExisting) 743List<LogEntry>? addedEntries = null; 760foreach (var existingEntry in existingEntries) 766foreach (var logEntry in logEntries) 803foreach (var logEntry in addedEntries) 815private sealed class Subscription(ResourceLoggerState loggerState, Action<LogEntry> log) : IDisposable 845loggerState.AddLog(LogEntry.Create(logTime, logMessage, isErrorMessage), inMemorySource: true); 850private static LogLine[] CreateLogLines(ref int lineNumber, IReadOnlyList<LogEntry> entries) 855var entry = entries[i]; 897public IAsyncEnumerable<IReadOnlyList<LogEntry>> GetAllLogsAsync(string resourceName, CancellationToken cancellationToken)
Dcp\DcpResourceWatcher.cs (12)
428var logEntries = new List<LogEntry>(); 546public async IAsyncEnumerable<IReadOnlyList<LogEntry>> GetAllLogsAsync(string resourceName, [EnumeratorCancellation] CancellationToken cancellationToken) 566var logs = new List<LogEntry>(); 567foreach (var logEntry in CreateLogEntries(batch)) 577private static IEnumerable<LogEntry> CreateLogEntries(IReadOnlyList<ResourceLogEntry> batch) 590yield return LogEntry.Create(timestamp, resolvedContent, entry.RawContent ?? entry.Content, entry.IsErrorMessage, resourcePrefix: null); 700private void SetPendingFollowLogDeduplication(string resourceName, string? resourceUid, IReadOnlyList<LogEntry> flushedLogEntries) 724foreach (var logEntry in flushedLogEntries) 761private List<LogEntry> DeduplicateFollowBatch(string resourceName, LogStreamState logStream, List<LogEntry> logEntries) 773List<LogEntry>? addedEntries = null; 774foreach (var logEntry in logEntries)
IConsoleLogsService.cs (1)
10IAsyncEnumerable<IReadOnlyList<LogEntry>> GetAllLogsAsync(string resourceName, CancellationToken cancellationToken);
src\Shared\ConsoleLogs\LogEntries.cs (8)
19private readonly CircularBuffer<LogEntry> _logEntries = new(maximumEntryCount); 27public IList<LogEntry> GetEntries() => _logEntries; 45foreach (var pauseEntry in pauseEntries) 60public bool ProcessPauseFilters(LogEntry logEntry) 83public void InsertSorted(LogEntry logLine) 99var entry = _logEntries[i]; 114private void InsertSortedCore(LogEntry logEntry) 126var 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.Tests (13)
Dashboard\DashboardEventHandlersTests.cs (3)
60dashboardLoggerState.AddLog(LogEntry.Create(timestamp, logMessage, isErrorMessage: false), inMemorySource: true); 116dashboardLoggerState.AddLog(LogEntry.Create(timestamp, messageJson, isErrorMessage: false), inMemorySource: true); 131dashboardLoggerState.AddLog(LogEntry.Create(timestamp, sentinelJson, isErrorMessage: false), inMemorySource: true);
Dashboard\DashboardServiceTests.cs (2)
40var getConsoleLogsChannel = Channel.CreateUnbounded<IReadOnlyList<LogEntry>>(); 80await 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>>(); 798private static LogEntry CreateLogEntry(string content) 800return LogEntry.Create(timestamp: null, content, isErrorMessage: false); 803private 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)