mirror of https://github.com/dotnet/tye.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.0 KiB
38 lines
1.0 KiB
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System;
|
|
|
|
namespace Microsoft.Extensions.Logging.Testing
|
|
{
|
|
public class TestLogger<T> : ILogger
|
|
{
|
|
private readonly ILogger _logger;
|
|
|
|
public TestLogger(TestLoggerFactory factory)
|
|
{
|
|
_logger = factory.CreateLogger<T>();
|
|
}
|
|
|
|
public IDisposable BeginScope<TState>(TState state)
|
|
{
|
|
return _logger.BeginScope(state);
|
|
}
|
|
|
|
public bool IsEnabled(LogLevel logLevel)
|
|
{
|
|
return _logger.IsEnabled(logLevel);
|
|
}
|
|
|
|
public void Log<TState>(
|
|
LogLevel logLevel,
|
|
EventId eventId,
|
|
TState state,
|
|
Exception exception,
|
|
Func<TState, Exception, string> formatter)
|
|
{
|
|
_logger.Log(logLevel, eventId, state, exception, formatter);
|
|
}
|
|
}
|
|
}
|
|
|