Updated logger
This commit is contained in:
@@ -24,7 +24,7 @@ public class Exit: ICommandAction
|
||||
{
|
||||
if (args is null || args.Length == 0)
|
||||
{
|
||||
Application.CurrentApplication.Logger.Log("Exiting...", typeof(ICommandAction), LogType.WARNING);
|
||||
Application.CurrentApplication.Logger.Log("Exiting...", this, LogType.WARNING);
|
||||
await Application.CurrentApplication.ApplicationEnvironmentVariables.SaveToFile();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class Exit: ICommandAction
|
||||
|
||||
case "-f":
|
||||
case "force":
|
||||
Application.CurrentApplication.Logger.Log("Exiting (FORCE)...", typeof(ICommandAction), LogType.WARNING);
|
||||
Application.CurrentApplication.Logger.Log("Exiting (FORCE)...", this, LogType.WARNING);
|
||||
Environment.Exit(0);
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -148,15 +149,13 @@ internal static class PluginMethods
|
||||
{
|
||||
if (data.IsSuccess)
|
||||
{
|
||||
Application.CurrentApplication.Logger.Log("Successfully loaded command : " + data.PluginName, typeof(ICommandAction),
|
||||
LogType.INFO
|
||||
);
|
||||
Application.CurrentApplication.Logger.Log("Successfully loaded command : " + data.PluginName, LogType.INFO, "\t\t > {Message}");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Application.CurrentApplication.Logger.Log("Failed to load command : " + data.PluginName + " because " + data.ErrorMessage,
|
||||
typeof(ICommandAction), LogType.ERROR
|
||||
typeof(PluginMethods), LogType.ERROR
|
||||
);
|
||||
}
|
||||
|
||||
@@ -166,14 +165,12 @@ internal static class PluginMethods
|
||||
{
|
||||
if (data.IsSuccess)
|
||||
{
|
||||
Application.CurrentApplication.Logger.Log("Successfully loaded event : " + data.PluginName, typeof(ICommandAction),
|
||||
LogType.INFO
|
||||
);
|
||||
Application.CurrentApplication.Logger.Log("Successfully loaded event : " + data.PluginName, LogType.INFO, "\t\t > {Message}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.CurrentApplication.Logger.Log("Failed to load event : " + data.PluginName + " because " + data.ErrorMessage,
|
||||
typeof(ICommandAction), LogType.ERROR
|
||||
typeof(PluginMethods), LogType.ERROR
|
||||
);
|
||||
}
|
||||
|
||||
@@ -184,14 +181,12 @@ internal static class PluginMethods
|
||||
{
|
||||
if (data.IsSuccess)
|
||||
{
|
||||
Application.CurrentApplication.Logger.Log("Successfully loaded slash command : " + data.PluginName, typeof(ICommandAction),
|
||||
LogType.INFO
|
||||
);
|
||||
Application.CurrentApplication.Logger.Log("Successfully loaded slash command : " + data.PluginName, LogType.INFO, "\t\t > {Message}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.CurrentApplication.Logger.Log("Failed to load slash command : " + data.PluginName + " because " + data.ErrorMessage,
|
||||
typeof(ICommandAction), LogType.ERROR
|
||||
typeof(PluginMethods), LogType.ERROR
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,13 +61,13 @@ public class Plugin: ICommandAction
|
||||
case "load":
|
||||
if (pluginsLoaded)
|
||||
{
|
||||
Application.CurrentApplication.Logger.Log("Plugins already loaded", typeof(ICommandAction), LogType.WARNING);
|
||||
Application.CurrentApplication.Logger.Log("Plugins already loaded", this, LogType.WARNING);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Application.CurrentApplication.DiscordBotClient is null)
|
||||
{
|
||||
Application.CurrentApplication.Logger.Log("DiscordBot is null", typeof(ICommandAction), LogType.WARNING);
|
||||
Application.CurrentApplication.Logger.Log("DiscordBot is null", this, LogType.WARNING);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user