refactor: use new plugin log
This commit is contained in:
parent
45fe83f1b0
commit
357bc2bb6f
|
@ -1,5 +1,4 @@
|
||||||
using Dalamud.Game.Command;
|
using Dalamud.Game.Command;
|
||||||
using Dalamud.Logging;
|
|
||||||
|
|
||||||
namespace ChatTwo;
|
namespace ChatTwo;
|
||||||
|
|
||||||
|
@ -45,14 +44,14 @@ internal sealed class Commands : IDisposable {
|
||||||
|
|
||||||
private void Invoke(string command, string arguments) {
|
private void Invoke(string command, string arguments) {
|
||||||
if (!this.Registered.TryGetValue(command, out var wrapper)) {
|
if (!this.Registered.TryGetValue(command, out var wrapper)) {
|
||||||
PluginLog.Warning($"Missing registration for command {command}");
|
Plugin.Log.Warning($"Missing registration for command {command}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
wrapper.Invoke(command, arguments);
|
wrapper.Invoke(command, arguments);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
PluginLog.Error(ex, $"Error while executing command {command}");
|
Plugin.Log.Error(ex, $"Error while executing command {command}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ using ChatTwo.Code;
|
||||||
using ChatTwo.Resources;
|
using ChatTwo.Resources;
|
||||||
using ChatTwo.Ui;
|
using ChatTwo.Ui;
|
||||||
using Dalamud.Configuration;
|
using Dalamud.Configuration;
|
||||||
using Dalamud.Logging;
|
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
|
|
||||||
namespace ChatTwo;
|
namespace ChatTwo;
|
||||||
|
@ -124,7 +123,7 @@ internal class Configuration : IPluginConfiguration {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
PluginLog.Warning($"Couldn't migrate config version {this.Version}");
|
Plugin.Log.Warning($"Couldn't migrate config version {this.Version}");
|
||||||
loop = false;
|
loop = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ using Dalamud.Game.ClientState.Keys;
|
||||||
using Dalamud.Game.Config;
|
using Dalamud.Game.Config;
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
using Dalamud.Hooking;
|
using Dalamud.Hooking;
|
||||||
using Dalamud.Logging;
|
|
||||||
using Dalamud.Memory;
|
using Dalamud.Memory;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using Dalamud.Utility.Signatures;
|
using Dalamud.Utility.Signatures;
|
||||||
|
@ -432,7 +431,7 @@ internal sealed unsafe class Chat : IDisposable {
|
||||||
TellReason = TellReason.Reply,
|
TellReason = TellReason.Reply,
|
||||||
});
|
});
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
PluginLog.LogError(ex, "Error in chat Activated event");
|
Plugin.Log.Error(ex, "Error in chat Activated event");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -483,7 +482,7 @@ internal sealed unsafe class Chat : IDisposable {
|
||||||
};
|
};
|
||||||
this.Activated?.Invoke(args);
|
this.Activated?.Invoke(args);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
PluginLog.LogError(ex, "Error in chat Activated event");
|
Plugin.Log.Error(ex, "Error in chat Activated event");
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent the game from focusing the chat log
|
// prevent the game from focusing the chat log
|
||||||
|
@ -566,7 +565,7 @@ internal sealed unsafe class Chat : IDisposable {
|
||||||
TellTarget = target,
|
TellTarget = target,
|
||||||
});
|
});
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
PluginLog.LogError(ex, "Error in chat Activated event");
|
Plugin.Log.Error(ex, "Error in chat Activated event");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ using Dalamud.Game.Text.SeStringHandling;
|
||||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Logging;
|
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using Lumina.Excel.GeneratedSheets;
|
using Lumina.Excel.GeneratedSheets;
|
||||||
|
@ -101,7 +100,7 @@ internal sealed class PayloadHandler {
|
||||||
try {
|
try {
|
||||||
this.Ui.Plugin.Ipc.Invoke(id, sender, contentId, payload, chunk.Message?.SenderSource, chunk.Message?.ContentSource);
|
this.Ui.Plugin.Ipc.Invoke(id, sender, contentId, payload, chunk.Message?.SenderSource, chunk.Message?.ContentSource);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
PluginLog.Error(ex, "Error executing integration");
|
Plugin.Log.Error(ex, "Error executing integration");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +353,7 @@ internal sealed class PayloadHandler {
|
||||||
try {
|
try {
|
||||||
action(link.CommandId, new SeString(payloads));
|
action(link.CommandId, new SeString(payloads));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
PluginLog.LogError(ex, "Error executing DalamudLinkPayload handler");
|
Plugin.Log.Error(ex, "Error executing DalamudLinkPayload handler");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ using System.Runtime.InteropServices;
|
||||||
using ChatTwo.Ui;
|
using ChatTwo.Ui;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.GameFonts;
|
using Dalamud.Interface.GameFonts;
|
||||||
using Dalamud.Logging;
|
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
|
|
||||||
namespace ChatTwo;
|
namespace ChatTwo;
|
||||||
|
@ -151,7 +150,7 @@ internal sealed class PluginUi : IDisposable {
|
||||||
try {
|
try {
|
||||||
component.Draw();
|
component.Draw();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
PluginLog.LogError(ex, "Error drawing component");
|
Plugin.Log.Error(ex, "Error drawing component");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ using ChatTwo.Resources;
|
||||||
using ChatTwo.Util;
|
using ChatTwo.Util;
|
||||||
using Dalamud.Game.Text;
|
using Dalamud.Game.Text;
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
using Dalamud.Logging;
|
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using LiteDB;
|
using LiteDB;
|
||||||
|
@ -250,7 +249,7 @@ internal class Store : IDisposable {
|
||||||
var lastId = ObjectId.Empty;
|
var lastId = ObjectId.Empty;
|
||||||
for (var i = 0; i < rounds; i++) {
|
for (var i = 0; i < rounds; i++) {
|
||||||
this._migrateCurrent = i + 1;
|
this._migrateCurrent = i + 1;
|
||||||
PluginLog.Log($"Update round {i + 1}/{rounds}");
|
Plugin.Log.Info($"Update round {i + 1}/{rounds}");
|
||||||
var messages = this.Messages.Query()
|
var messages = this.Messages.Query()
|
||||||
.OrderBy(msg => msg.Id)
|
.OrderBy(msg => msg.Id)
|
||||||
.Where(msg => msg.Id > lastId)
|
.Where(msg => msg.Id > lastId)
|
||||||
|
|
|
@ -13,7 +13,6 @@ using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Logging;
|
|
||||||
using Dalamud.Memory;
|
using Dalamud.Memory;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using Lumina.Excel.GeneratedSheets;
|
using Lumina.Excel.GeneratedSheets;
|
||||||
|
@ -328,7 +327,7 @@ internal sealed class ChatLog : IUiComponent {
|
||||||
TellReason = reason,
|
TellReason = reason,
|
||||||
});
|
});
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
PluginLog.LogError(ex, "Error in chat Activated event");
|
Plugin.Log.Error(ex, "Error in chat Activated event");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,10 @@ internal sealed class ChatColours : ISettingsTab {
|
||||||
.ToHashSet();
|
.ToHashSet();
|
||||||
var total = Enum.GetValues<ChatType>().Where(type => !type.IsGm()).ToHashSet();
|
var total = Enum.GetValues<ChatType>().Where(type => !type.IsGm()).ToHashSet();
|
||||||
if (sortable.Count != total.Count) {
|
if (sortable.Count != total.Count) {
|
||||||
Dalamud.Logging.PluginLog.Warning($"There are {sortable.Count} sortable channels, but there are {total.Count} total channels.");
|
Dalamud.Logging.Plugin.Log.Warning($"There are {sortable.Count} sortable channels, but there are {total.Count} total channels.");
|
||||||
total.ExceptWith(sortable);
|
total.ExceptWith(sortable);
|
||||||
foreach (var missing in total) {
|
foreach (var missing in total) {
|
||||||
Dalamud.Logging.PluginLog.Log($"Missing {missing}");
|
Dalamud.Logging.Plugin.Log.Log($"Missing {missing}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue