From d57eba7f631d36ba6cd379dbbadf1715c4b0386c Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Fri, 10 Feb 2023 22:36:34 -0800 Subject: [PATCH 1/4] feat: Add LogRaw to PluginLog Adds the ability to send a log message to Serilog specifying a log level at runtime. This feature is primarily aimed at allowing developers to easily bridge disparate logging systems without hardcoding log level calls. --- Dalamud/Logging/PluginLog.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Dalamud/Logging/PluginLog.cs b/Dalamud/Logging/PluginLog.cs index a5aad330f..80edbe430 100644 --- a/Dalamud/Logging/PluginLog.cs +++ b/Dalamud/Logging/PluginLog.cs @@ -240,6 +240,20 @@ public static class PluginLog #endregion + /// + /// Log a message to the in-game log, setting level at runtime. + /// + /// + /// This method is primarily meant for interoperability with other logging systems that may want to be forwarded to + /// the PluginLog. + /// + /// The log level for this message. + /// An exception (if any) to include in this log message. + /// The message template. + /// Values to log. + public static void LogRaw(LogEventLevel level, Exception? exception, string messageTemplate, params object[] values) + => WriteLog(Assembly.GetCallingAssembly().GetName().Name, level, messageTemplate, exception, values); + private static ILogger GetPluginLogger(string? pluginName) { return Serilog.Log.ForContext("SourceContext", pluginName ?? string.Empty); From 4f3727c78b8aa51bf340670e8d07a41ac70ce1c8 Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Fri, 10 Feb 2023 22:37:33 -0800 Subject: [PATCH 2/4] chore: Convert Exception to nullable in PluginLog Allows specifying Exception as a nullable parameter to various Log calls where an Exception may or may not be present in the caller. --- Dalamud/Logging/PluginLog.cs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Dalamud/Logging/PluginLog.cs b/Dalamud/Logging/PluginLog.cs index 80edbe430..b2f2a5065 100644 --- a/Dalamud/Logging/PluginLog.cs +++ b/Dalamud/Logging/PluginLog.cs @@ -27,7 +27,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Log(Exception exception, string messageTemplate, params object[] values) + public static void Log(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Information, messageTemplate, exception, values); /// @@ -44,7 +44,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogVerbose(Exception exception, string messageTemplate, params object[] values) + public static void LogVerbose(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Verbose, messageTemplate, exception, values); /// @@ -61,7 +61,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogDebug(Exception exception, string messageTemplate, params object[] values) + public static void LogDebug(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Debug, messageTemplate, exception, values); /// @@ -78,7 +78,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogInformation(Exception exception, string messageTemplate, params object[] values) + public static void LogInformation(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Information, messageTemplate, exception, values); /// @@ -95,7 +95,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogWarning(Exception exception, string messageTemplate, params object[] values) + public static void LogWarning(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Warning, messageTemplate, exception, values); /// @@ -112,7 +112,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogError(Exception exception, string messageTemplate, params object[] values) + public static void LogError(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Error, messageTemplate, exception, values); /// @@ -129,7 +129,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void LogFatal(Exception exception, string messageTemplate, params object[] values) + public static void LogFatal(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Fatal, messageTemplate, exception, values); #endregion @@ -150,7 +150,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Verbose(Exception exception, string messageTemplate, params object[] values) + public static void Verbose(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Verbose, messageTemplate, exception, values); /// @@ -167,7 +167,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Debug(Exception exception, string messageTemplate, params object[] values) + public static void Debug(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Debug, messageTemplate, exception, values); /// @@ -184,7 +184,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Information(Exception exception, string messageTemplate, params object[] values) + public static void Information(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Information, messageTemplate, exception, values); /// @@ -201,7 +201,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Warning(Exception exception, string messageTemplate, params object[] values) + public static void Warning(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Warning, messageTemplate, exception, values); /// @@ -218,7 +218,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Error(Exception exception, string messageTemplate, params object[] values) + public static void Error(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Error, messageTemplate, exception, values); /// @@ -235,7 +235,7 @@ public static class PluginLog /// The exception that caused the error. /// The message template. /// Values to log. - public static void Fatal(Exception exception, string messageTemplate, params object[] values) + public static void Fatal(Exception? exception, string messageTemplate, params object[] values) => WriteLog(Assembly.GetCallingAssembly().GetName().Name, LogEventLevel.Fatal, messageTemplate, exception, values); #endregion From 67e1e6b07154f52a94fbcf145750f8387feea398 Mon Sep 17 00:00:00 2001 From: Soreepeong Date: Sat, 11 Feb 2023 23:09:31 +0900 Subject: [PATCH 3/4] Fix borderless fullscreen window restoring --- Dalamud.Boot/xivfixes.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dalamud.Boot/xivfixes.cpp b/Dalamud.Boot/xivfixes.cpp index 3bdf4fe23..bfbca7d8a 100644 --- a/Dalamud.Boot/xivfixes.cpp +++ b/Dalamud.Boot/xivfixes.cpp @@ -197,6 +197,10 @@ void xivfixes::prevent_devicechange_crashes(bool bApply) { } } + // While at it, prevent game from entering restored mode if the game does not have window frames (borderless window/fullscreen.) + if (uMsg == WM_SIZE && wParam == SIZE_RESTORED && (GetWindowLongW(hWnd, GWL_STYLE) & WS_POPUP)) + return ShowWindow(hWnd, SW_MAXIMIZE); + return s_pfnGameWndProc(hWnd, uMsg, wParam, lParam); }); From 140a710678daff3fc48e643664245ed0e6807cd1 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sat, 11 Feb 2023 20:18:33 +0100 Subject: [PATCH 4/4] build: 7.4.4.1 --- Dalamud/Dalamud.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Dalamud.csproj b/Dalamud/Dalamud.csproj index ca9c34c91..9cb0784a1 100644 --- a/Dalamud/Dalamud.csproj +++ b/Dalamud/Dalamud.csproj @@ -8,7 +8,7 @@ - 7.4.4.0 + 7.4.4.1 XIV Launcher addon framework $(DalamudVersion) $(DalamudVersion)