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)
144
internal Action<
LogEntry
> GetInternalLogger(string resourceName)
365
private readonly CircularBuffer<
LogEntry
> _inMemoryEntries = new(MaxLogCount);
412
List<
LogEntry
> inMemoryEntries;
436
var channel = Channel.CreateUnbounded<
LogEntry
>();
441
void Log(
LogEntry
log) => channel.Writer.TryWrite(log);
443
LogEntry
[] backlogSnapshot;
452
foreach (
var
logEntry in _inMemoryEntries)
494
private Action<
LogEntry
>? _onNewLog;
495
private event Action<
LogEntry
> OnNewLog
556
internal
LogEntry
[] GetBacklogSnapshot()
564
public void AddLog(
LogEntry
logEntry, bool inMemorySource)
605
loggerState.AddLog(
LogEntry
.Create(logTime, logMessage, isErrorMessage), inMemorySource: true);
610
private static LogLine[] CreateLogLines(ref int lineNumber, IReadOnlyList<
LogEntry
> entries)
615
var
entry = entries[i];
657
public IAsyncEnumerable<IReadOnlyList<
LogEntry
>> GetAllLogsAsync(string resourceName, CancellationToken cancellationToken)
Dcp\DcpExecutor.cs (6)
643
public async IAsyncEnumerable<IReadOnlyList<
LogEntry
>> GetAllLogsAsync(string resourceName, [EnumeratorCancellation] CancellationToken cancellationToken)
663
var logs = new List<
LogEntry
>();
664
foreach (
var
logEntry in CreateLogEntries(batch))
674
private static IEnumerable<
LogEntry
> CreateLogEntries(IReadOnlyList<(string, bool)> batch)
687
yield return
LogEntry
.Create(timestamp, resolvedContent, content, logEntryType, resourcePrefix: null);
727
foreach (
var
logEntry in CreateLogEntries(batch))
IConsoleLogsService.cs (1)
10
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)
65
dashboardLoggerState.AddLog(
LogEntry
.Create(timestamp, logMessage, isErrorMessage: false), inMemorySource: true);
Dashboard\DashboardServiceTests.cs (2)
36
var getConsoleLogsChannel = Channel.CreateUnbounded<IReadOnlyList<
LogEntry
>>();
76
await getConsoleLogsChannel.Writer.WriteAsync([
LogEntry
.Create(null, "Test3", isErrorMessage: false)]);
ResourceLoggerServiceTests.cs (4)
262
var consoleLogsChannel0 = Channel.CreateUnbounded<IReadOnlyList<
LogEntry
>>();
263
consoleLogsChannel0.Writer.TryWrite([
LogEntry
.Create(timestamp: null, logMessage: "instance0!", isErrorMessage: false)]);
266
var consoleLogsChannel1 = Channel.CreateUnbounded<IReadOnlyList<
LogEntry
>>();
267
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)