diff --git a/tests/apps/Odin.Hosting.Tests/WebScaffold.cs b/tests/apps/Odin.Hosting.Tests/WebScaffold.cs index b539f9af7..bb527573e 100644 --- a/tests/apps/Odin.Hosting.Tests/WebScaffold.cs +++ b/tests/apps/Odin.Hosting.Tests/WebScaffold.cs @@ -421,6 +421,26 @@ public Dictionary> GetLogEvents() return logEvents; } + public void DumpLogEventsToConsole() + { + Console.WriteLine("--------======== Log Events Begin ========--------"); + + var logEvents = new List(); + var keyedLogEvents = GetLogEvents(); + foreach (var (level, events) in keyedLogEvents) + { + logEvents.AddRange(events); + } + + logEvents.Sort((a,b) => a.Timestamp < b.Timestamp ? -1 : 1); + foreach (var logEvent in logEvents) + { + Console.WriteLine($"{logEvent.Timestamp.ToUnixTimeMilliseconds()} {logEvent.RenderMessage()}"); + } + + Console.WriteLine("--------======== Log Events End ========--------"); + } + public void ClearLogEvents() { Services.GetRequiredService().Clear();