mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-18 13:57:43 +01:00
Merge pull request #2594 from Haselnussbomber/troubleshooting-json
Write troubleshooting to json file
This commit is contained in:
commit
28e39ab9e2
2 changed files with 13 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
|
@ -68,6 +69,7 @@ public static class Troubleshooting
|
||||||
{
|
{
|
||||||
var payload = new TroubleshootingPayload
|
var payload = new TroubleshootingPayload
|
||||||
{
|
{
|
||||||
|
Timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
|
||||||
LoadedPlugins = pluginManager?.InstalledPlugins?.Select(x => x.Manifest as LocalPluginManifest)?.OrderByDescending(x => x.InternalName).ToArray(),
|
LoadedPlugins = pluginManager?.InstalledPlugins?.Select(x => x.Manifest as LocalPluginManifest)?.OrderByDescending(x => x.InternalName).ToArray(),
|
||||||
PluginStates = pluginManager?.InstalledPlugins?.Where(x => !x.IsDev).ToDictionary(x => x.Manifest.InternalName, x => x.IsBanned ? "Banned" : x.State.ToString()),
|
PluginStates = pluginManager?.InstalledPlugins?.Where(x => !x.IsDev).ToDictionary(x => x.Manifest.InternalName, x => x.IsBanned ? "Banned" : x.State.ToString()),
|
||||||
EverStartedLoadingPlugins = pluginManager?.InstalledPlugins.Where(x => x.HasEverStartedLoad).Select(x => x.InternalName).ToList(),
|
EverStartedLoadingPlugins = pluginManager?.InstalledPlugins.Where(x => x.HasEverStartedLoad).Select(x => x.InternalName).ToList(),
|
||||||
|
|
@ -85,6 +87,13 @@ public static class Troubleshooting
|
||||||
|
|
||||||
var encodedPayload = Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(payload)));
|
var encodedPayload = Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(payload)));
|
||||||
Log.Information($"TROUBLESHOOTING:{encodedPayload}");
|
Log.Information($"TROUBLESHOOTING:{encodedPayload}");
|
||||||
|
|
||||||
|
File.WriteAllText(
|
||||||
|
Path.Join(
|
||||||
|
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||||
|
"XIVLauncher",
|
||||||
|
"dalamud.troubleshooting.json"),
|
||||||
|
JsonConvert.SerializeObject(payload, Formatting.Indented));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
@ -103,6 +112,8 @@ public static class Troubleshooting
|
||||||
|
|
||||||
private class TroubleshootingPayload
|
private class TroubleshootingPayload
|
||||||
{
|
{
|
||||||
|
public long Timestamp { get; set; }
|
||||||
|
|
||||||
public LocalPluginManifest[]? LoadedPlugins { get; set; }
|
public LocalPluginManifest[]? LoadedPlugins { get; set; }
|
||||||
|
|
||||||
public Dictionary<string, string>? PluginStates { get; set; }
|
public Dictionary<string, string>? PluginStates { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -476,6 +476,7 @@ void export_tspack(HWND hWndParent, const std::filesystem::path& logDir, const s
|
||||||
"launcher.log", // XIVLauncher.Core for [mostly] Linux
|
"launcher.log", // XIVLauncher.Core for [mostly] Linux
|
||||||
"patcher.log",
|
"patcher.log",
|
||||||
"dalamud.log",
|
"dalamud.log",
|
||||||
|
"dalamud.troubleshooting.json",
|
||||||
"dalamud.injector.log",
|
"dalamud.injector.log",
|
||||||
"dalamud.boot.log",
|
"dalamud.boot.log",
|
||||||
"aria.log",
|
"aria.log",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue