mirror of
https://github.com/AlexMacocian/MTSC.git
synced 2026-07-18 08:19:32 +00:00
0fe9f9957c
* Setup OAuth2 support * Setup tests project * Setup OAuth2 unit tests in CI pipeline * Setup authorizeattribute tests * Test * Setup tests for AuthorizeAttribute * Setup OAuth2 support Unit Tests coverage * Add OAuth2 project to release
30 lines
779 B
C#
30 lines
779 B
C#
using Microsoft.Extensions.Logging;
|
|
using MTSC.ServerSide;
|
|
using System;
|
|
|
|
namespace MTSC.OAuth2.Models
|
|
{
|
|
internal sealed class ServerDebugLogger<T> : ILogger<T>
|
|
{
|
|
private readonly Server server;
|
|
|
|
public ServerDebugLogger(Server server)
|
|
{
|
|
this.server = server;
|
|
}
|
|
|
|
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)
|
|
{
|
|
var message = formatter(state, exception);
|
|
this.server.LogDebug(message);
|
|
}
|
|
}
|
|
}
|