This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
gameservicewarden/tests/GameServiceWarden.Core.Tests/XUnitLogger.cs
Harrison Deng dfc54fdc00 Implemented IPC system with minimal testing.
Large naming refactoring.

Added some more tests.
2021-04-08 21:36:08 -05:00

29 lines
690 B
C#

using System;
using GameServiceWarden.Core.Logging;
using Xunit.Abstractions;
namespace GameServiceWarden.Core.Tests
{
public class XUnitLogger : ILogReceiver
{
public LogLevel Level => LogLevel.DEBUG;
public string Identifier => GetType().Name;
private ITestOutputHelper outputHelper;
public XUnitLogger(ITestOutputHelper output)
{
this.outputHelper = output;
}
public void Flush()
{
}
public void LogMessage(string message, DateTime time, LogLevel level)
{
outputHelper.WriteLine($"[{time.ToShortTimeString()}][{level.ToString()}]: {message}");
}
}
}