props/test/MultiShop.Shop/AliExpressModule.Tests/XUnitLogger.cs
Harrison Deng 6c684372df Changed to hosted blazorwasm project.
Restructured project following changes.

Moved shop assembly fetching to public facing Web API.
2021-05-21 13:32:25 -05:00

33 lines
774 B
C#

using System;
using SimpleLogger;
using Xunit.Abstractions;
namespace MultiShop.Shop.AliExpressModule
{
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)
{
try
{
outputHelper.WriteLine($"[{time.ToShortTimeString()}][{level.ToString()}]: {message}");
}
catch (InvalidOperationException) { };
}
}
}