diff --git a/src/Aspire.Dashboard/ConsoleLogs/TimestampParser.cs b/src/Aspire.Dashboard/ConsoleLogs/TimestampParser.cs index a64b8c07db..7f7a4f5b98 100644 --- a/src/Aspire.Dashboard/ConsoleLogs/TimestampParser.cs +++ b/src/Aspire.Dashboard/ConsoleLogs/TimestampParser.cs @@ -74,5 +74,5 @@ private static string ConvertTimestampFromUtc(ReadOnlySpan timestamp) [GeneratedRegex("^(?:\\d{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])T(?:[01][0-9]|2[0-3]):(?:[0-5][0-9]):(?:[0-5][0-9])(?:\\.\\d{1,9})?(?:Z|(?:[Z+-](?:[01][0-9]|2[0-3]):(?:[0-5][0-9])))?")] private static partial Regex GenerateRfc3339RegEx(); - public readonly record struct TimestampParserResult(string? ModifiedText, string? Timestamp); + public readonly record struct TimestampParserResult(string ModifiedText, string Timestamp); } diff --git a/src/Aspire.Dashboard/Otlp/Model/OtlpLogEntry.cs b/src/Aspire.Dashboard/Otlp/Model/OtlpLogEntry.cs index 2620689c23..6edbfda92e 100644 --- a/src/Aspire.Dashboard/Otlp/Model/OtlpLogEntry.cs +++ b/src/Aspire.Dashboard/Otlp/Model/OtlpLogEntry.cs @@ -36,7 +36,7 @@ public OtlpLogEntry(LogRecord record, OtlpApplication logApp, OtlpScope scope) // Explicitly ignore these break; default: - properties.Add(new KeyValuePair(kv.Key, kv.Value.GetString())); + properties.Add(KeyValuePair.Create(kv.Key, kv.Value.GetString())); break; } } diff --git a/src/Aspire.Hosting/Dashboard/DockerContainerLogSource.cs b/src/Aspire.Hosting/Dashboard/DockerContainerLogSource.cs index dd5f5feb50..48126ab001 100644 --- a/src/Aspire.Hosting/Dashboard/DockerContainerLogSource.cs +++ b/src/Aspire.Hosting/Dashboard/DockerContainerLogSource.cs @@ -34,7 +34,7 @@ public async IAsyncEnumerable WatchOutputLogAsync([EnumeratorCancellat { if (_containerLogWatcher is not null) { - await foreach (var logs in _containerLogWatcher!.WatchOutputLogsAsync(cancellationToken).ConfigureAwait(false)) + await foreach (var logs in _containerLogWatcher.WatchOutputLogsAsync(cancellationToken).ConfigureAwait(false)) { yield return logs; } @@ -45,7 +45,7 @@ public async IAsyncEnumerable WatchErrorLogAsync([EnumeratorCancellati { if (_containerLogWatcher is not null) { - await foreach (var logs in _containerLogWatcher!.WatchErrorLogsAsync(cancellationToken).ConfigureAwait(false)) + await foreach (var logs in _containerLogWatcher.WatchErrorLogsAsync(cancellationToken).ConfigureAwait(false)) { yield return logs; } diff --git a/src/Aspire.Hosting/Dashboard/FileLogSource.cs b/src/Aspire.Hosting/Dashboard/FileLogSource.cs index a6f28e0875..c37fa74307 100644 --- a/src/Aspire.Hosting/Dashboard/FileLogSource.cs +++ b/src/Aspire.Hosting/Dashboard/FileLogSource.cs @@ -62,10 +62,10 @@ private static async IAsyncEnumerable WatchLogAsync(string filePath, [ while (!cancellationToken.IsCancellationRequested) { var reader = PipeReader.Create(fileStream, s_streamPipeReaderOptions); - + while (!cancellationToken.IsCancellationRequested) { - var result = await reader!.ReadAsync(cancellationToken).ConfigureAwait(false); + var result = await reader.ReadAsync(cancellationToken).ConfigureAwait(false); if (result.IsCompleted) {