log db queries

This commit is contained in:
hydrant
2020-03-25 19:23:58 +01:00
parent 40504bfb75
commit 2f70a60c22
3 changed files with 13 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using ReallifeGamemode.Database.Models;
using ReallifeGamemode.Server.Core.API;
@@ -26,6 +27,8 @@ namespace ReallifeGamemode.Server.Core
API = api;
EventHandler = eventHandler;
DatabaseContext.LoggerFactory = LogManager.Factory;
API.DisableDefaultCommandErrorMessages();
API.DisableDefaultSpawnBehavior();
API.SetGlobalChatEnabled(false);
@@ -61,9 +64,9 @@ namespace ReallifeGamemode.Server.Core
}
}
public static DatabaseContext GetDbContext(bool useLoggerFactory = true)
public static DatabaseContext GetDbContext(bool useLoggerFactory = false)
{
return new DatabaseContext(useLoggerFactory ? LogManager.Factory : null);
return new DatabaseContext(useLoggerFactory);
}
internal static TScript GetScript<TScript>() where TScript : Script