Debug query logging

This commit is contained in:
Noi 2022-03-20 22:33:16 -07:00
parent 4e0f23c033
commit a88797cb0a

View file

@ -24,6 +24,9 @@ public class BotDatabaseContext : DbContext {
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder
.UseNpgsql(NpgsqlConnectionString)
#if DEBUG
.LogTo((string line) => Program.Log("EF", line), Microsoft.Extensions.Logging.LogLevel.Information)
#endif
.UseSnakeCaseNamingConvention();
protected override void OnModelCreating(ModelBuilder modelBuilder) {