From ac3404d380509b9bbf50958c9f5e1b21f165f0fa Mon Sep 17 00:00:00 2001 From: Masusder <59669685+Masusder@users.noreply.github.com> Date: Sun, 22 Nov 2026 13:50:30 +0100 Subject: [PATCH] Open log --- CUE4Parse | 2 +- FModel/App.xaml.cs | 10 ++++++---- FModel/MainWindow.xaml | 18 ++++++++++++++++++ FModel/ViewModels/Commands/MenuCommand.cs | 5 +++++ 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/CUE4Parse b/CUE4Parse index 7f3a0ccf..c95dd9b5 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 7f3a0ccf121d538b1cceb3c81278189b2161d0cc +Subproject commit c95dd9b587a6fb8cbf030d6b84d37cd0c7512b7d diff --git a/FModel/App.xaml.cs b/FModel/App.xaml.cs index 225143b3..d4fdea25 100644 --- a/FModel/App.xaml.cs +++ b/FModel/App.xaml.cs @@ -27,6 +27,8 @@ namespace FModel; /// public partial class App { + public string LogFilePath { get; private set; } + [DllImport("kernel32.dll")] private static extern bool AttachConsole(int dwProcessId); @@ -115,7 +117,7 @@ public partial class App CacheManager.EnsureDirectories(); #if DEBUG - var filePath = Path.Combine(UserSettings.Default.LogsDirectory, $"FModel-Debug-Log-{DateTime.Now:yyyy-MM-dd}.log"); + LogFilePath = Path.Combine(UserSettings.Default.LogsDirectory, $"FModel-Debug-Log-{DateTime.Now:yyyy-MM-dd}.log"); var viewerContexts = typeof(Snooper.Hosting.Bridge).Assembly.GetTypes() .Concat(typeof(EditorWindow).Assembly.GetTypes()) @@ -123,7 +125,7 @@ public partial class App .Append("Snooper") .ToHashSet(StringComparer.Ordinal); #else - var filePath = Path.Combine(UserSettings.Default.LogsDirectory, $"FModel-Log-{DateTime.Now:yyyy-MM-dd}.log"); + LogFilePath = Path.Combine(UserSettings.Default.LogsDirectory, $"FModel-Log-{DateTime.Now:yyyy-MM-dd}.log"); #endif const string template1 = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] {SourceContext}: {Message:lj}{NewLine}{Exception}"; const string template2 = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{ClassName}] {ObjectPath}: {Message:lj}{NewLine}{Exception}"; @@ -143,11 +145,11 @@ public partial class App .WriteTo.Logger(lc => lc .Filter.ByExcluding(IsConversionLibrary) .WriteTo.Console(outputTemplate: template1, theme: AnsiConsoleTheme.Literate) - .WriteTo.File(outputTemplate: template1, path: filePath, shared: true)) + .WriteTo.File(outputTemplate: template1, path: LogFilePath, shared: true)) .WriteTo.Logger(lc => lc .Filter.ByIncludingOnly(IsConversionLibrary) .WriteTo.Console(outputTemplate: template2, theme: AnsiConsoleTheme.Literate) - .WriteTo.File(outputTemplate: template2, path: filePath, shared: true)) + .WriteTo.File(outputTemplate: template2, path: LogFilePath, shared: true)) .MinimumLevel.Override("CUE4Parse_Conversion", LogEventLevel.Verbose) .WriteTo.Sink(ImGuiSink.Instance) .CreateLogger(); diff --git a/FModel/MainWindow.xaml b/FModel/MainWindow.xaml index ac86a319..c79a0f23 100644 --- a/FModel/MainWindow.xaml +++ b/FModel/MainWindow.xaml @@ -692,6 +692,24 @@ +