fix: separate diagnostics gui log and accept ntfs prefix alias

This commit is contained in:
Meik
2026-03-10 10:19:44 +01:00
parent 599ee096a0
commit d893e165b6
2 changed files with 20 additions and 9 deletions

View File

@@ -35,7 +35,8 @@ namespace LiamWorkflowDiagnostics
private ProviderTestSession _session;
private bool _isInitializingUi;
private readonly object _diagnosticsLogSync = new object();
private string _diagnosticsLogPath;
private string _diagnosticsGuiLogPath;
private string _diagnosticsStandardLogPath;
private readonly string _settingsPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "LiamWorkflowDiagnostics.settings.json");
public MainWindow()
@@ -67,10 +68,12 @@ namespace LiamWorkflowDiagnostics
var baseDir = AppDomain.CurrentDomain.BaseDirectory;
var logDirectory = Path.Combine(baseDir, "logs");
Directory.CreateDirectory(logDirectory);
_diagnosticsLogPath = Path.Combine(logDirectory, "LiamWorkflowDiagnostics.log");
cLogManagerFile.CreateInstance(_diagnosticsLogPath);
_diagnosticsStandardLogPath = Path.Combine(logDirectory, "LiamWorkflowDiagnostics.log");
_diagnosticsGuiLogPath = Path.Combine(logDirectory, "LiamWorkflowDiagnostics.gui.log");
cLogManagerFile.CreateInstance(_diagnosticsStandardLogPath);
cLogManager.Instance.Level = LogLevels.Debug;
AppendLog($"Logdatei: {_diagnosticsLogPath} (Level: Debug)");
AppendLog($"GUI-Logdatei: {_diagnosticsGuiLogPath}");
AppendLog($"Standard-Logdatei: {_diagnosticsStandardLogPath} (Level: Debug)");
}
catch (Exception ex)
{
@@ -140,12 +143,12 @@ namespace LiamWorkflowDiagnostics
try
{
if (!string.IsNullOrWhiteSpace(_diagnosticsLogPath))
if (!string.IsNullOrWhiteSpace(_diagnosticsGuiLogPath))
{
var fileLine = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} [{level}] {message}{Environment.NewLine}";
lock (_diagnosticsLogSync)
{
File.AppendAllText(_diagnosticsLogPath, fileLine, Encoding.UTF8);
File.AppendAllText(_diagnosticsGuiLogPath, fileLine, Encoding.UTF8);
}
}
}