add analyzers and api

This commit is contained in:
Stanley Dimant
2022-10-03 15:58:51 +02:00
parent 3b9b260ab3
commit 260c4a48ee
34 changed files with 435 additions and 265 deletions

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Concurrent;
using Microsoft.Extensions.Logging;
namespace MareSynchronos.Utils;
[ProviderAlias("Dalamud")]
public class DalamudLoggingProvider : ILoggerProvider
{
private readonly ConcurrentDictionary<string, Logger> _loggers =
new(StringComparer.OrdinalIgnoreCase);
public DalamudLoggingProvider()
{
}
public ILogger CreateLogger(string categoryName)
{
return _loggers.GetOrAdd(categoryName, name => new Logger(categoryName));
}
public void Dispose()
{
_loggers.Clear();
}
}