Disable trace logging by default

This commit is contained in:
Loporrit
2025-08-23 08:27:08 +00:00
parent 2168fa91ce
commit 1768d68df2
4 changed files with 36 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ using MareSynchronos.WebAPI.Files.Models;
using MareSynchronos.WebAPI.SignalR.Utils;
using Microsoft.Extensions.Logging;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Globalization;
using System.Numerics;
using System.Text.Json;
@@ -679,6 +680,26 @@ public class SettingsUi : WindowMediatorSubscriberBase
_configService.Save();
}, _configService.Current.LogLevel);
bool logTraceToFile = _configService.Current.LogTraceLog;
if (ImGui.Checkbox("Enable Trace Logging to File", ref logTraceToFile))
{
_configService.Current.LogTraceLog = logTraceToFile;
_configService.Save();
LoporritSync.Plugin.Self.ToggleFileLogging(_configService.Current.LogTraceLog, "Setting Change");
}
ImGui.SameLine(300.0f * ImGuiHelpers.GlobalScale);
if (_uiShared.IconTextButton(FontAwesomeIcon.FolderOpen, "Open TraceLog folder"))
{
ProcessStartInfo ps = new()
{
FileName = Path.Combine(_configService.ConfigurationDirectory, "tracelog"),
UseShellExecute = true,
WindowStyle = ProcessWindowStyle.Normal
};
Process.Start(ps);
}
bool logPerformance = _configService.Current.LogPerformance;
if (ImGui.Checkbox("Log Performance Counters", ref logPerformance))
{