Canon/Canon.Tests/Utils/TestLogger.cs
jackfiled 6130adfa7c feat: 按照open_set中的示例调整语法 (#71)
添加了构建LR分析表冲突的报错

Reviewed-on: PostGuard/Canon#71
2024-05-01 21:06:27 +08:00

17 lines
499 B
C#

using Canon.Core.Abstractions;
using Microsoft.Extensions.Logging;
using Xunit.Abstractions;
namespace Canon.Tests.Utils;
public class TestLogger(ITestOutputHelper testOutputHelper) : ICompilerLogger
{
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception,
Func<TState, Exception?, string> formatter)
{
testOutputHelper.WriteLine($"{logLevel}: {formatter(state, exception)}");
}
public string Build() => string.Empty;
}