private ServerDbBase _db = default!;
private LoggingProvider _msLogProvider = default!;
private ILoggerFactory _msLoggerFactory = default!;
+ private ISawmill _sawmill = default!;
private bool _synchronous;
// When running in integration tests, we'll use a single in-memory SQLite database connection.
{
builder.AddProvider(_msLogProvider);
});
+ _sawmill = _logMgr.GetSawmill("db.manager");
_synchronous = _cfg.GetCVar(CCVars.DatabaseSynchronous);
Password = pass
}.ConnectionString;
- Logger.DebugS("db.manager", $"Using Postgres \"{host}:{port}/{db}\"");
+ _sawmill.Debug($"Using Postgres \"{host}:{port}/{db}\"");
builder.UseNpgsql(connectionString);
SetupLogging(builder);
if (!inMemory)
{
var finalPreferencesDbPath = Path.Combine(_res.UserData.RootDir!, configPreferencesDbPath);
- Logger.DebugS("db.manager", $"Using SQLite DB \"{finalPreferencesDbPath}\"");
+ _sawmill.Debug($"Using SQLite DB \"{finalPreferencesDbPath}\"");
getConnection = () => new SqliteConnection($"Data Source={finalPreferencesDbPath}");
}
else
{
- Logger.DebugS("db.manager", "Using in-memory SQLite DB");
+ _sawmill.Debug("Using in-memory SQLite DB");
_sqliteInMemoryConnection = new SqliteConnection("Data Source=:memory:");
// When using an in-memory DB we have to open it manually
// so EFCore doesn't open, close and wipe it every operation.