You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
EntityFrameworkCore.Jet/test/EFCore.Jet.Tests/Utilities/FakeInterceptingLogger.cs

40 lines
1.2 KiB
C#

// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Diagnostics;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.Extensions.Logging;
namespace EntityFrameworkCore.Jet.Tests.Utilities
{
public class FakeDiagnosticsLogger<T> : IDiagnosticsLogger<T>, ILogger
where T : LoggerCategory<T>, new()
{
public ILoggingOptions Options { get; }
public bool ShouldLogSensitiveData() => false;
public ILogger Logger => this;
public DiagnosticSource DiagnosticSource { get; } = new DiagnosticListener("Fake");
public void Log<TState>(
LogLevel logLevel,
EventId eventId,
TState state,
Exception exception,
Func<TState, Exception, string> formatter)
{
}
public bool IsEnabled(LogLevel logLevel) => true;
public bool IsEnabled(EventId eventId, LogLevel logLevel) => true;
public WarningBehavior GetLogBehavior(EventId eventId, LogLevel logLevel) => WarningBehavior.Log;
public IDisposable BeginScope<TState>(TState state) => null;
}
}