mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Add error logging
This commit is contained in:
parent
3e8be33a5c
commit
34617cf377
1 changed files with 13 additions and 1 deletions
|
|
@ -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<string, CommandInfo> commandMap = new();
|
||||
private readonly Regex commandRegexEn = new(@"^The command (?<command>.+) does not exist\.$", RegexOptions.Compiled);
|
||||
private readonly Regex commandRegexJp = new(@"^そのコマンドはありません。: (?<command>.+)$", 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<CommandManager>.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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue