mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 20:06:33 +00:00
Redid some of the surface editor and started working on layout saving
This commit is contained in:
1 parent
f3650445d9
commit
a34786fb5d
48 files changed
+1012
-107
No files matched your search
@@ -1,8 +1,10 @@
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using Artemis.Core.Exceptions;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.Storage.Repositories;
|
||||
using Artemis.Storage.Repositories.Interfaces;
|
||||
using Ninject.Extensions.Conventions;
|
||||
using Ninject.Modules;
|
||||
using Serilog;
|
||||
|
||||
namespace Artemis.Core.Ninject
|
||||
{
|
||||
@@ -10,6 +12,9 @@ namespace Artemis.Core.Ninject
|
||||
{
|
||||
public override void Load()
|
||||
{
|
||||
if (Kernel == null)
|
||||
throw new ArtemisCoreException("Failed to bind Ninject Core module, kernel is null.");
|
||||
|
||||
// Bind all services as singletons
|
||||
Kernel.Bind(x =>
|
||||
{
|
||||
@@ -31,6 +36,7 @@ namespace Artemis.Core.Ninject
|
||||
});
|
||||
|
||||
Kernel.Bind<PluginSettings>().ToProvider<PluginSettingsProvider>();
|
||||
Kernel.Bind<ILogger>().ToProvider<LoggerProvider>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Ninject.Activation;
|
||||
using Serilog;
|
||||
|
||||
namespace Artemis.Core.Ninject
|
||||
{
|
||||
internal class LoggerProvider : Provider<ILogger>
|
||||
{
|
||||
private static readonly ILogger _logger = new LoggerConfiguration()
|
||||
.Enrich.FromLogContext()
|
||||
.Enrich.WithDemystifiedStackTraces()
|
||||
.WriteTo.File("Artemis log-.txt",
|
||||
rollingInterval: RollingInterval.Day,
|
||||
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext:l}] {Message:lj}{NewLine}{Exception}")
|
||||
.CreateLogger();
|
||||
|
||||
protected override ILogger CreateInstance(IContext context)
|
||||
{
|
||||
var requestingType = context.Request.ParentContext?.Plan?.Type;
|
||||
if (requestingType != null)
|
||||
return _logger.ForContext(requestingType);
|
||||
return _logger;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
using Artemis.Core.Exceptions;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using Artemis.Storage.Repositories;
|
||||
using Artemis.Storage.Repositories.Interfaces;
|
||||
using Ninject.Activation;
|
||||
|
||||
namespace Artemis.Core.Ninject
|
||||
|
||||
Reference in new issue
Block a user