2019-03-25 20:20:54 +01:00
|
|
|
|
using Bit.Core;
|
|
|
|
|
using DbUp.Engine.Output;
|
2019-03-25 18:21:05 +01:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
2022-08-29 22:06:55 +02:00
|
|
|
|
namespace Bit.Migrator;
|
|
|
|
|
|
|
|
|
|
public class DbUpLogger : IUpgradeLog
|
2019-03-25 18:21:05 +01:00
|
|
|
|
{
|
2022-08-29 22:06:55 +02:00
|
|
|
|
private readonly ILogger _logger;
|
2019-03-25 18:21:05 +01:00
|
|
|
|
|
2022-08-29 22:06:55 +02:00
|
|
|
|
public DbUpLogger(ILogger logger)
|
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
2019-03-25 18:21:05 +01:00
|
|
|
|
|
2022-08-29 22:06:55 +02:00
|
|
|
|
public void WriteError(string format, params object[] args)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError(Constants.BypassFiltersEventId, format, args);
|
|
|
|
|
}
|
2019-03-25 18:21:05 +01:00
|
|
|
|
|
2022-08-29 22:06:55 +02:00
|
|
|
|
public void WriteInformation(string format, params object[] args)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation(Constants.BypassFiltersEventId, format, args);
|
|
|
|
|
}
|
2022-08-29 21:53:48 +02:00
|
|
|
|
|
2022-08-29 22:06:55 +02:00
|
|
|
|
public void WriteWarning(string format, params object[] args)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogWarning(Constants.BypassFiltersEventId, format, args);
|
2019-03-25 18:21:05 +01:00
|
|
|
|
}
|
|
|
|
|
}
|