From 34617cf377b7805b0fa60296fcfccb3af73c6ca1 Mon Sep 17 00:00:00 2001 From: MidoriKami <9083275+MidoriKami@users.noreply.github.com> Date: Mon, 18 Sep 2023 10:50:05 -0700 Subject: [PATCH] Add error logging --- Dalamud/Game/Command/CommandManager.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Dalamud/Game/Command/CommandManager.cs b/Dalamud/Game/Command/CommandManager.cs index 56630a5ad..118d210e2 100644 --- a/Dalamud/Game/Command/CommandManager.cs +++ b/Dalamud/Game/Command/CommandManager.cs @@ -8,8 +8,8 @@ using Dalamud.Game.Text; using Dalamud.Game.Text.SeStringHandling; using Dalamud.IoC; using Dalamud.IoC.Internal; +using Dalamud.Logging.Internal; using Dalamud.Plugin.Services; -using Serilog; namespace Dalamud.Game.Command; @@ -20,6 +20,8 @@ namespace Dalamud.Game.Command; [ServiceManager.BlockingEarlyLoadedService] internal sealed class CommandManager : IServiceType, IDisposable, ICommandManager { + private static readonly ModuleLog Log = new("Command"); + private readonly ConcurrentDictionary commandMap = new(); private readonly Regex commandRegexEn = new(@"^The command (?.+) does not exist\.$", RegexOptions.Compiled); private readonly Regex commandRegexJp = new(@"^そのコマンドはありません。: (?.+)$", RegexOptions.Compiled); @@ -169,6 +171,8 @@ internal sealed class CommandManager : IServiceType, IDisposable, ICommandManage #pragma warning restore SA1015 internal class CommandManagerPluginScoped : IDisposable, IServiceType, ICommandManager { + private static readonly ModuleLog Log = new("Command"); + [ServiceManager.ServiceDependency] private readonly CommandManager commandManagerService = Service.Get(); @@ -207,6 +211,10 @@ internal class CommandManagerPluginScoped : IDisposable, IServiceType, ICommandM return true; } } + else + { + Log.Error($"Command {command} is already registered."); + } return false; } @@ -222,6 +230,10 @@ internal class CommandManagerPluginScoped : IDisposable, IServiceType, ICommandM return true; } } + else + { + Log.Error($"Command {command} not found."); + } return false; }