2019-01-27 22:08:49 +01:00
|
|
|
|
using Geekbot.net.Lib;
|
|
|
|
|
using Geekbot.net.Lib.Logger;
|
2018-05-10 00:00:51 +02:00
|
|
|
|
using Npgsql.Logging;
|
|
|
|
|
|
|
|
|
|
namespace Geekbot.net.Database.LoggingAdapter
|
|
|
|
|
{
|
|
|
|
|
public class NpgsqlLoggingProviderAdapter : INpgsqlLoggingProvider
|
|
|
|
|
{
|
|
|
|
|
private readonly GeekbotLogger _geekbotLogger;
|
2019-01-27 22:08:49 +01:00
|
|
|
|
private readonly RunParameters _runParameters;
|
2018-05-10 00:00:51 +02:00
|
|
|
|
|
2019-01-27 22:08:49 +01:00
|
|
|
|
public NpgsqlLoggingProviderAdapter(GeekbotLogger geekbotLogger, RunParameters runParameters)
|
2018-05-10 00:00:51 +02:00
|
|
|
|
{
|
|
|
|
|
_geekbotLogger = geekbotLogger;
|
2019-01-27 22:08:49 +01:00
|
|
|
|
_runParameters = runParameters;
|
2018-05-10 00:00:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public NpgsqlLogger CreateLogger(string name)
|
|
|
|
|
{
|
2019-01-27 22:08:49 +01:00
|
|
|
|
return new NpgsqlLoggingAdapter(name, _geekbotLogger, _runParameters);
|
2018-05-10 00:00:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|