mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Profile editor - Only save profile on drag-edit when mouse is released
Profile editor - Format all numbers with 3 decimals Profile editor - Fixed drag-edit rounding errors with very small steps Logging - Output logs to debug Settings - Added logging level setting Nuget - Updated Serilog and the used sinks
This commit is contained in:
1 parent
05cf1f0b53
commit
318a679744
26 files changed
+323
-161
No files matched your search
@@ -1,24 +1,30 @@
|
||||
using Ninject.Activation;
|
||||
using Serilog;
|
||||
using Serilog.Core;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace Artemis.Core.Ninject
|
||||
{
|
||||
internal class LoggerProvider : Provider<ILogger>
|
||||
{
|
||||
private static readonly ILogger _logger = new LoggerConfiguration()
|
||||
internal static readonly LoggingLevelSwitch LoggingLevelSwitch = new LoggingLevelSwitch(LogEventLevel.Verbose);
|
||||
|
||||
private static readonly ILogger Logger = new LoggerConfiguration()
|
||||
.Enrich.FromLogContext()
|
||||
.Enrich.WithDemystifiedStackTraces()
|
||||
.WriteTo.File("Logs/Artemis log-.txt",
|
||||
rollingInterval: RollingInterval.Day,
|
||||
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext:l}] {Message:lj}{NewLine}{Exception}")
|
||||
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}")
|
||||
.WriteTo.Debug()
|
||||
.MinimumLevel.ControlledBy(LoggingLevelSwitch)
|
||||
.CreateLogger();
|
||||
|
||||
protected override ILogger CreateInstance(IContext context)
|
||||
{
|
||||
var requestingType = context.Request.ParentContext?.Plan?.Type;
|
||||
if (requestingType != null)
|
||||
return _logger.ForContext(requestingType);
|
||||
return _logger;
|
||||
return Logger.ForContext(requestingType);
|
||||
return Logger;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user