From ccff87fc6354cfa193f507bdd15d5888daab2620 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Thu, 8 Apr 2021 22:26:44 -0500 Subject: [PATCH] XUnitLogger will dispose of messages after test completion. --- tests/GameServiceWarden.Core.Tests/XUnitLogger.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/GameServiceWarden.Core.Tests/XUnitLogger.cs b/tests/GameServiceWarden.Core.Tests/XUnitLogger.cs index 4cd8d6b..a73b71a 100644 --- a/tests/GameServiceWarden.Core.Tests/XUnitLogger.cs +++ b/tests/GameServiceWarden.Core.Tests/XUnitLogger.cs @@ -23,7 +23,11 @@ namespace GameServiceWarden.Core.Tests public void LogMessage(string message, DateTime time, LogLevel level) { - outputHelper.WriteLine($"[{time.ToShortTimeString()}][{level.ToString()}]: {message}"); + try + { + outputHelper.WriteLine($"[{time.ToShortTimeString()}][{level.ToString()}]: {message}"); + } + catch (InvalidOperationException) { }; } } } \ No newline at end of file