From 5d6a91ffb9dca2dfd24840a814d02f3f8769e2c9 Mon Sep 17 00:00:00 2001 From: EonaCat Date: Fri, 9 Jan 2026 20:06:35 +0100 Subject: [PATCH] Updated --- .../EonaCat.Logger.Test.Web.csproj | 2 +- Testers/EonaCat.Logger.Test.Web/Program.cs | 30 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Testers/EonaCat.Logger.Test.Web/EonaCat.Logger.Test.Web.csproj b/Testers/EonaCat.Logger.Test.Web/EonaCat.Logger.Test.Web.csproj index 16c3fa4..2921571 100644 --- a/Testers/EonaCat.Logger.Test.Web/EonaCat.Logger.Test.Web.csproj +++ b/Testers/EonaCat.Logger.Test.Web/EonaCat.Logger.Test.Web.csproj @@ -8,7 +8,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Testers/EonaCat.Logger.Test.Web/Program.cs b/Testers/EonaCat.Logger.Test.Web/Program.cs index d0c0137..741e5b9 100644 --- a/Testers/EonaCat.Logger.Test.Web/Program.cs +++ b/Testers/EonaCat.Logger.Test.Web/Program.cs @@ -74,16 +74,14 @@ // Now all EonaCat.Logger logs will be sent to LogCentral automatically await logger.LogAsync("This is a test log message sent to LogCentral!", ELogType.INFO).ConfigureAwait(false); - Console.WriteLine(DllInfo.EonaCatVersion); - Console.WriteLine(VersionHelper.GetInformationalVersion()); - - - // Generate a memory leak for testing var jsonLogger = new JsonFileLoggerProvider().CreateLogger("MyCategory") as JsonFileLogger; jsonLogger?.SetContext("CorrelationId", "abc-123"); jsonLogger?.SetContext("UserId", "john.doe"); jsonLogger?.LogInformation("User logged in"); + Console.WriteLine(DllInfo.EonaCatVersion); + Console.Title = VersionHelper.GetInformationalVersion(); + void LoggerSettings_OnLog(EonaCatLogMessage message) { Console.ForegroundColor = ConsoleColor.Yellow; @@ -212,15 +210,15 @@ } MemoryLeakTester.Start(logger); - await Task.Run(RunMemoryReportTask).ConfigureAwait(false); - await Task.Run(RunMaskTest).ConfigureAwait(false); - await Task.Run(RunWebLoggerTestsAsync).ConfigureAwait(false); - await Task.Run(RunWebLoggingTests).ConfigureAwait(false); - await Task.Run(RunLoggingTestsAsync).ConfigureAwait(false); - await Task.Run(RunLoggingExceptionTests).ConfigureAwait(false); - await Task.Run(RunWebLoggingExceptionTests).ConfigureAwait(false); + _ = Task.Run(RunMemoryReportTask).ConfigureAwait(false); + _ = Task.Run(RunMaskTest).ConfigureAwait(false); + _ = Task.Run(RunWebLoggerTestsAsync).ConfigureAwait(false); + _ = Task.Run(RunWebLoggingTests).ConfigureAwait(false); + _ = Task.Run(RunLoggingTestsAsync).ConfigureAwait(false); + _ = Task.Run(RunLoggingExceptionTests).ConfigureAwait(false); + _ = Task.Run(RunWebLoggingExceptionTests).ConfigureAwait(false); - async void RunMemoryReportTask() + async Task RunMemoryReportTask() { while (true) { @@ -253,7 +251,7 @@ } } - async void RunWebLoggingTests() + async Task RunWebLoggingTests() { if (!Directory.Exists(logger.LogFolder)) { @@ -272,7 +270,7 @@ } } - async void RunMaskTest() + async Task RunMaskTest() { if (!Directory.Exists(logger.LogFolder)) { @@ -357,7 +355,7 @@ private static void Instance_LeakDetected(object? sender, EonaCat.MemoryGuard.EventArguments.MemoryLeakDetectedEventArgs e) { - throw new NotImplementedException(); + // Leak detected } }