Add more debug logging to admin logs

This commit is contained in:
DrSmugleaf
2021-12-20 01:23:11 +01:00
parent 4eee199665
commit f23ca09d09
2 changed files with 10 additions and 0 deletions

View File

@@ -38,6 +38,10 @@ namespace Content.Server.Database
{
x.Ignore(CoreEventId.ManyServiceProvidersCreatedWarning);
});
#if DEBUG
options.EnableSensitiveDataLogging();
#endif
}
public PostgresServerDbContext(DbContextOptions<ServerDbContext> options) : base(options)

View File

@@ -14,6 +14,7 @@ using Robust.Shared.Configuration;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Timing;
using static Content.Shared.Administration.AdminLogsEuiMsg;
namespace Content.Server.Administration.Logs;
@@ -142,6 +143,9 @@ public sealed class AdminLogsEui : BaseEui
private async void SendLogs(bool replace)
{
var stopwatch = new Stopwatch();
stopwatch.Start();
// TODO ADMIN LOGS array pool
var logs = new List<SharedAdminLog>(_clientBatchSize);
@@ -171,6 +175,8 @@ public sealed class AdminLogsEui : BaseEui
var message = new NewLogs(logs.ToArray(), replace);
SendMessage(message);
_sawmill.Info($"Sent {logs.Count} logs to {Player.Name} in {stopwatch.Elapsed.TotalMilliseconds} ms");
}
public override void Closed()