2 instantiations of LogEntry
Aspire.Hosting (2)
src\Shared\ConsoleLogs\LogEntry.cs (2)
29
return new
LogEntry
51
return new
LogEntry
43 references to LogEntry
Aspire.Hosting (33)
ApplicationModel\ResourceLoggerService.cs (15)
142
internal Action<
LogEntry
> GetInternalLogger(string resourceName)
349
private readonly CircularBuffer<
LogEntry
> _inMemoryEntries = new(MaxLogCount);
396
List<
LogEntry
> inMemoryEntries;
420
var channel = Channel.CreateUnbounded<
LogEntry
>();
425
void Log(
LogEntry
log) => channel.Writer.TryWrite(log);
427
LogEntry
[] backlogSnapshot;
436
foreach (
var
logEntry in _inMemoryEntries)
478
private Action<
LogEntry
>? _onNewLog;
479
private event Action<
LogEntry
> OnNewLog
540
internal
LogEntry
[] GetBacklogSnapshot()
548
public void AddLog(
LogEntry
logEntry, bool inMemorySource)
589
loggerState.AddLog(
LogEntry
.Create(logTime, logMessage, isErrorMessage), inMemorySource: true);
594
private static LogLine[] CreateLogLines(ref int lineNumber, IReadOnlyList<
LogEntry
> entries)
599
var
entry = entries[i];
620
public IAsyncEnumerable<IReadOnlyList<
LogEntry
>> GetAllLogsAsync(string resourceName, CancellationToken cancellationToken)
Dcp\DcpExecutor.cs (6)
580
public async IAsyncEnumerable<IReadOnlyList<
LogEntry
>> GetAllLogsAsync(string resourceName, [EnumeratorCancellation] CancellationToken cancellationToken)
600
var logs = new List<
LogEntry
>();
601
foreach (
var
logEntry in CreateLogEntries(batch))
611
private static IEnumerable<
LogEntry
> CreateLogEntries(IReadOnlyList<(string, bool)> batch)
624
yield return
LogEntry
.Create(timestamp, resolvedContent, content, logEntryType, resourcePrefix: null);
664
foreach (
var
logEntry in CreateLogEntries(batch))
IConsoleLogsService.cs (1)
8
IAsyncEnumerable<IReadOnlyList<
LogEntry
>> GetAllLogsAsync(string resourceName, CancellationToken cancellationToken);
src\Shared\ConsoleLogs\LogEntries.cs (8)
19
private readonly CircularBuffer<
LogEntry
> _logEntries = new(maximumEntryCount);
27
public IList<
LogEntry
> GetEntries() => _logEntries;
45
foreach (
var
pauseEntry in pauseEntries)
60
public bool ProcessPauseFilters(
LogEntry
logEntry)
83
public void InsertSorted(
LogEntry
logLine)
99
var
entry = _logEntries[i];
114
private void InsertSortedCore(
LogEntry
logEntry)
126
var
current = _logEntries[rowIndex];
src\Shared\ConsoleLogs\LogEntry.cs (3)
27
public static
LogEntry
CreatePause(string resourcePrefix, DateTime startTimestamp, DateTime? endTimestamp = null)
44
public static
LogEntry
Create(DateTime? timestamp, string logMessage, bool isErrorMessage)
49
public static
LogEntry
Create(DateTime? timestamp, string logMessage, string rawLogContent, bool isErrorMessage, string? resourcePrefix)
Aspire.Hosting.Tests (10)
Dashboard\DashboardLifecycleHookTests.cs (1)
62
dashboardLoggerState.AddLog(
LogEntry
.Create(timestamp, logMessage, isErrorMessage: false), inMemorySource: true);
Dashboard\DashboardServiceTests.cs (2)
35
var getConsoleLogsChannel = Channel.CreateUnbounded<IReadOnlyList<
LogEntry
>>();
75
await getConsoleLogsChannel.Writer.WriteAsync([
LogEntry
.Create(null, "Test3", isErrorMessage: false)]);
ResourceLoggerServiceTests.cs (4)
261
var consoleLogsChannel0 = Channel.CreateUnbounded<IReadOnlyList<
LogEntry
>>();
262
consoleLogsChannel0.Writer.TryWrite([
LogEntry
.Create(timestamp: null, logMessage: "instance0!", isErrorMessage: false)]);
265
var consoleLogsChannel1 = Channel.CreateUnbounded<IReadOnlyList<
LogEntry
>>();
266
consoleLogsChannel1.Writer.TryWrite([
LogEntry
.Create(timestamp: null, logMessage: "instance1!", isErrorMessage: false)]);
Utils\TestConsoleLogsService.cs (3)
12
private readonly Func<string, Channel<IReadOnlyList<
LogEntry
>>>? _getConsoleLogsChannel;
14
public TestConsoleLogsService(Func<string, Channel<IReadOnlyList<
LogEntry
>>>? getConsoleLogsChannel = null)
19
public async IAsyncEnumerable<IReadOnlyList<
LogEntry
>> GetAllLogsAsync(string resourceName, [EnumeratorCancellation] CancellationToken cancellationToken)