Replace nancy with kestrel

This commit is contained in:
runebaas 2018-05-14 02:33:49 +02:00
parent 3004b19209
commit 8c107de92e
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
13 changed files with 222 additions and 117 deletions

View file

@ -0,0 +1,29 @@
using System;
using System.Collections.Concurrent;
using Geekbot.net.Lib.Logger;
using Microsoft.Extensions.Logging;
namespace Geekbot.net.WebApi.Logging
{
public class AspLogProvider : ILoggerProvider
{
private readonly IGeekbotLogger _geekbotLogger;
private readonly ConcurrentDictionary<string, AspLogger> _loggers = new ConcurrentDictionary<string, AspLogger>();
public AspLogProvider(IGeekbotLogger geekbotLogger)
{
_geekbotLogger = geekbotLogger;
}
public void Dispose()
{
_loggers.Clear();
}
public ILogger CreateLogger(string categoryName)
{
return _loggers.GetOrAdd(categoryName, name => new AspLogger(categoryName, _geekbotLogger));
}
}
}