From f23ca09d09a9e961ea32ecc8a375259f6f885f1b Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Mon, 20 Dec 2021 01:23:11 +0100 Subject: [PATCH] Add more debug logging to admin logs --- Content.Server.Database/ModelPostgres.cs | 4 ++++ Content.Server/Administration/Logs/AdminLogsEui.cs | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/Content.Server.Database/ModelPostgres.cs b/Content.Server.Database/ModelPostgres.cs index 891e2e91d0..6fa6a62685 100644 --- a/Content.Server.Database/ModelPostgres.cs +++ b/Content.Server.Database/ModelPostgres.cs @@ -38,6 +38,10 @@ namespace Content.Server.Database { x.Ignore(CoreEventId.ManyServiceProvidersCreatedWarning); }); + +#if DEBUG + options.EnableSensitiveDataLogging(); +#endif } public PostgresServerDbContext(DbContextOptions options) : base(options) diff --git a/Content.Server/Administration/Logs/AdminLogsEui.cs b/Content.Server/Administration/Logs/AdminLogsEui.cs index 02e66232ef..72b169b158 100644 --- a/Content.Server/Administration/Logs/AdminLogsEui.cs +++ b/Content.Server/Administration/Logs/AdminLogsEui.cs @@ -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(_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()