|
|
|
@ -2,6 +2,7 @@ |
|
|
|
using Perspex; |
|
|
|
using Perspex.Controls; |
|
|
|
using Perspex.Diagnostics; |
|
|
|
using Perspex.Logging.Serilog; |
|
|
|
using Perspex.Markup.Xaml; |
|
|
|
using Serilog; |
|
|
|
using Serilog.Filters; |
|
|
|
@ -15,13 +16,7 @@ namespace BindingTest |
|
|
|
RegisterServices(); |
|
|
|
InitializeSubsystems((int)Environment.OSVersion.Platform); |
|
|
|
InitializeComponent(); |
|
|
|
|
|
|
|
Log.Logger = new LoggerConfiguration() |
|
|
|
.Filter.ByIncludingOnly(Matching.WithProperty("Area", "Property")) |
|
|
|
.Filter.ByIncludingOnly(Matching.WithProperty("Property", "Text")) |
|
|
|
.MinimumLevel.Verbose() |
|
|
|
.WriteTo.Trace(outputTemplate: "[{Id:X8}] [{SourceContext}] {Message}") |
|
|
|
.CreateLogger(); |
|
|
|
InitializeLogging(); |
|
|
|
} |
|
|
|
|
|
|
|
public static void AttachDevTools(Window window) |
|
|
|
@ -41,5 +36,15 @@ namespace BindingTest |
|
|
|
{ |
|
|
|
PerspexXamlLoader.Load(this); |
|
|
|
} |
|
|
|
|
|
|
|
private void InitializeLogging() |
|
|
|
{ |
|
|
|
#if DEBUG
|
|
|
|
SerilogLogger.Initialize(new LoggerConfiguration() |
|
|
|
.MinimumLevel.Warning() |
|
|
|
.WriteTo.Trace(outputTemplate: "{Area}: {Message}") |
|
|
|
.CreateLogger()); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|