Fixed Startup error after downloading the logger
This commit is contained in:
@@ -87,6 +87,10 @@ namespace DiscordBotCore
|
||||
{
|
||||
moduleRequirementsSolver ??= requirement => CurrentApplication.ModuleManager.SolveRequirementIssues(requirement);
|
||||
await moduleRequirementsSolver(requirements);
|
||||
|
||||
await CurrentApplication.ModuleManager.LoadModules();
|
||||
|
||||
Logger._LoggerModule = CurrentApplication.ModuleManager.GetLoadedModuleWithTag(ModuleType.Logger);
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +146,7 @@ namespace DiscordBotCore
|
||||
/// </summary>
|
||||
public static class Logger
|
||||
{
|
||||
private static readonly LoadedModule _LoggerModule = CurrentApplication.ModuleManager.GetLoadedModuleWithTag(ModuleType.Logger);
|
||||
internal static LoadedModule _LoggerModule = null!; // initial is null, will be populated when the application will load all modules !!
|
||||
public static async void LogException(Exception ex, object sender, bool fullStackTrace = false)
|
||||
{
|
||||
await CurrentApplication.ModuleManager.InvokeMethod(_LoggerModule.Value, _LoggerModule.Value.MethodMapping["BaseLogException"], [ex, sender, fullStackTrace]);
|
||||
|
||||
@@ -181,6 +181,8 @@ namespace DiscordBotCore.Modules
|
||||
|
||||
internal async Task LoadModules()
|
||||
{
|
||||
Modules.Clear();
|
||||
|
||||
string moduleConfigPath = Application.CurrentApplication.ApplicationEnvironmentVariables
|
||||
.Get<string>("ModuleConfig", _BaseModuleConfig);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user