2022-03-21 12:05:12 +08:00
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
|
|
namespace Falcon.SugarApi.Test
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 测试用Logger实例
|
|
|
|
|
/// </summary>
|
2022-03-30 17:08:07 +08:00
|
|
|
|
public class TestLog<T> : ILogger,ILogger<T>
|
2022-03-21 12:05:12 +08:00
|
|
|
|
{
|
|
|
|
|
public IDisposable BeginScope<TState>(TState state) {
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsEnabled(LogLevel logLevel) => true;
|
|
|
|
|
|
|
|
|
|
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) {
|
|
|
|
|
Console.WriteLine(state?.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|