mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Corsair - Added Dominator Platinum RGB layout
Core - Improved startup logging
This commit is contained in:
1 parent
45177c848b
commit
2bbe6b6b07
8 files changed
+236
-19
No files matched your search
@@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using Artemis.Core.Events;
|
||||
using Artemis.Core.Exceptions;
|
||||
using Artemis.Core.JsonConverters;
|
||||
using Artemis.Core.Ninject;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.Core.Services.Storage.Interfaces;
|
||||
@@ -15,6 +15,7 @@ using RGB.NET.Core;
|
||||
using Serilog;
|
||||
using Serilog.Events;
|
||||
using SkiaSharp;
|
||||
using Module = Artemis.Core.Plugins.Abstract.Module;
|
||||
|
||||
namespace Artemis.Core.Services
|
||||
{
|
||||
@@ -73,7 +74,8 @@ namespace Artemis.Core.Services
|
||||
if (IsInitialized)
|
||||
throw new ArtemisCoreException("Cannot initialize the core as it is already initialized.");
|
||||
|
||||
_logger.Information("Initializing Artemis Core version {version}", typeof(CoreService).Assembly.GetName().Version);
|
||||
var versionAttribute = typeof(CoreService).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
|
||||
_logger.Information("Initializing Artemis Core version {version}", versionAttribute?.InformationalVersion);
|
||||
ApplyLoggingLevel();
|
||||
|
||||
// Initialize the services
|
||||
|
||||
@@ -75,8 +75,7 @@ namespace Artemis.Core.Services
|
||||
var metadataFile = Path.Combine(match.FullName, "plugin.json");
|
||||
if (!File.Exists(metadataFile))
|
||||
{
|
||||
_logger.Information("Copying missing built-in plugin {name} version: {version}",
|
||||
builtInPluginInfo.Name, builtInPluginInfo.Version);
|
||||
_logger.Debug("Copying missing built-in plugin {builtInPluginInfo}", builtInPluginInfo);
|
||||
CopyBuiltInPlugin(subDirectory);
|
||||
}
|
||||
else
|
||||
@@ -88,15 +87,13 @@ namespace Artemis.Core.Services
|
||||
#if DEBUG
|
||||
if (builtInPluginInfo.Version >= pluginInfo.Version)
|
||||
{
|
||||
_logger.Information("Copying updated built-in plugin {name} version: {version} (old version: {oldVersion})",
|
||||
builtInPluginInfo.Name, builtInPluginInfo.Version, pluginInfo.Version);
|
||||
_logger.Debug("Copying updated built-in plugin {builtInPluginInfo}", builtInPluginInfo);
|
||||
CopyBuiltInPlugin(subDirectory);
|
||||
}
|
||||
#else
|
||||
if (builtInPluginInfo.Version > pluginInfo.Version)
|
||||
if (builtInPluginInfo.Version > pluginInfo.Version)
|
||||
{
|
||||
_logger.Information("Copying updated built-in plugin {name} version: {version} (old version: {oldVersion})",
|
||||
builtInPluginInfo.Name, builtInPluginInfo.Version, pluginInfo.Version);
|
||||
_logger.Debug("Copying updated built-in plugin from {pluginInfo} to {builtInPluginInfo}", pluginInfo, builtInPluginInfo);
|
||||
CopyBuiltInPlugin(subDirectory);
|
||||
}
|
||||
#endif
|
||||
@@ -139,6 +136,8 @@ namespace Artemis.Core.Services
|
||||
// Locate the main entry
|
||||
var pluginInfo = JsonConvert.DeserializeObject<PluginInfo>(File.ReadAllText(metadataFile));
|
||||
pluginInfo.Directory = subDirectory;
|
||||
|
||||
_logger.Debug("Loading plugin {pluginInfo}", pluginInfo);
|
||||
OnPluginLoading(new PluginEventArgs(pluginInfo));
|
||||
LoadPlugin(pluginInfo);
|
||||
}
|
||||
@@ -165,11 +164,12 @@ namespace Artemis.Core.Services
|
||||
var threwException = false;
|
||||
try
|
||||
{
|
||||
_logger.Debug("Enabling plugin {pluginInfo}", pluginInfo);
|
||||
pluginInfo.Instance.SetEnabled(true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Warning(new ArtemisPluginException(pluginInfo, "Failed to load enable plugin", e), "Plugin exception");
|
||||
_logger.Warning(new ArtemisPluginException(pluginInfo, "Failed to enable plugin", e), "Plugin exception");
|
||||
pluginInfo.Enabled = false;
|
||||
threwException = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user