diff --git a/CSharp/Applications/AvaloniaLoggingDI/App.axaml b/CSharp/Applications/AvaloniaLoggingDI/App.axaml
deleted file mode 100644
index 9b23eab..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/App.axaml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingDI/App.axaml.cs b/CSharp/Applications/AvaloniaLoggingDI/App.axaml.cs
deleted file mode 100644
index 3009d81..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/App.axaml.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-using Avalonia;
-using Avalonia.Controls.ApplicationLifetimes;
-using Avalonia.Data.Core.Plugins;
-using Avalonia.Markup.Xaml;
-using AvaloniaLoggingDI.ViewModels;
-using AvaloniaLoggingDI.Views;
-using LogViewer.Avalonia;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Logging;
-using MsBox.Avalonia;
-using MsBox.Avalonia.Enums;
-using MsLogger.Core;
-using RandomLogging.Service;
-using System;
-using System.Drawing;
-using System.Linq;
-using System.Reflection;
-using System.Threading;
-using Icon = MsBox.Avalonia.Enums.Icon;
-
-namespace AvaloniaLoggingDI;
-
-public partial class App : Application
-{
- public override void Initialize()
- => AvaloniaXamlLoader.Load(this);
-
- public override void OnFrameworkInitializationCompleted()
- {
- if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
- {
- // Avoid duplicate validations from both Avalonia and the CommunityToolkit.
- // More info: https://docs.avaloniaui.net/docs/guides/development-guides/data-validation#manage-validationplugins
- DisableAvaloniaDataAnnotationValidation();
-
- // catch all unhandled errors
- AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
-
- HostApplicationBuilder builder = Microsoft.Extensions.Hosting.Host.CreateApplicationBuilder();
-
- builder
- /*
- * Note: For information on launch profiles for debugging,
- * see article: https://www.codeproject.com/Articles/5354478/NET-App-Settings-Demystified-Csharp-VB
- */
-
- // Register the Random Logging Service
- .AddRandomBackgroundService()
-
- // visual debugging tools
- .AddLogViewer()
-
- // Microsoft Logger
- //.Logging.AddDefaultDataStoreLogger();
-
- // uncomment to use custom logging colors (note: System.Drawing namespace)
- //
- .Logging.AddDefaultDataStoreLogger(options =>
- {
- options.Colors[LogLevel.Trace] = new()
- {
- Foreground = Color.White,
- Background = Color.DarkGray
- };
-
- options.Colors[LogLevel.Debug] = new()
- {
- Foreground = Color.White,
- Background = Color.Gray
- };
-
- options.Colors[LogLevel.Information] = new()
- {
- Foreground = Color.White,
- Background = Color.DodgerBlue
- };
-
- options.Colors[LogLevel.Warning] = new()
- {
- Foreground = Color.White,
- Background = Color.Orchid
- };
- });
-
- IServiceCollection services = builder.Services;
-
- services
- .AddSingleton()
- .AddSingleton(service => new MainWindow
- {
- DataContext = service.GetRequiredService()
- });
-
- Host = builder.Build();
- CancellationTokenSource = new();
-
- try
- {
- LogStartingMode();
-
- // set and show
- desktop.MainWindow = Host.Services.GetRequiredService();
- desktop.ShutdownRequested += OnShutdownRequested;
-
- // startup background services
- _ = Host.StartAsync(CancellationTokenSource.Token);
- }
- catch (OperationCanceledException)
- {
- // skip
- }
- catch (Exception ex)
- {
- ShowMessageBox("Unhandled Error", ex.Message);
- return;
- }
- }
-
- base.OnFrameworkInitializationCompleted();
- }
- private static void DisableAvaloniaDataAnnotationValidation()
- {
- // Get an array of plugins to remove
- var dataValidationPluginsToRemove = BindingPlugins.DataValidators.OfType().ToArray();
-
- // remove each entry found
- foreach (var plugin in dataValidationPluginsToRemove)
- {
- BindingPlugins.DataValidators.Remove(plugin);
- }
- }
- private void OnShutdownRequested(object? sender, ShutdownRequestedEventArgs e)
- => _ = Host?.StopAsync(CancellationTokenSource!.Token);
-
-
- private IHost? Host { get; set; }
- private CancellationTokenSource? CancellationTokenSource { get; set; }
-
-
- private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
- => ShowMessageBox("Unhandled Error", ((Exception)e.ExceptionObject).Message);
-
- private static void ShowMessageBox(string title, string message)
- {
- var box = MessageBoxManager.GetMessageBoxStandard(
- "Exception",
- text: message,
- ButtonEnum.Ok,
- Icon.Stop
- );
- _ = box.ShowAsync().GetAwaiter();
- }
-
- private void LogStartingMode()
- {
- // Get the Launch mode
- bool isDevelopment = string.Equals(Environment.GetEnvironmentVariable("DOTNET_MODIFIABLE_ASSEMBLIES"), "debug",
- StringComparison.OrdinalIgnoreCase);
-
- // initialize a logger & EventId
- ILogger logger = Host!.Services.GetRequiredService>();
- EventId eventId = new EventId(id: 0, name: Assembly.GetEntryAssembly()!.GetName().Name);
-
- // log a test pattern for each log level
- logger.TestPattern(eventId: eventId);
-
- // log that we have started...
- logger.Emit(eventId, LogLevel.Information, $"Running in {(isDevelopment ? "Debug" : "Release")} mode");
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingDI/Assets/avalonia-logo.ico b/CSharp/Applications/AvaloniaLoggingDI/Assets/avalonia-logo.ico
deleted file mode 100644
index f7da8bb..0000000
Binary files a/CSharp/Applications/AvaloniaLoggingDI/Assets/avalonia-logo.ico and /dev/null differ
diff --git a/CSharp/Applications/AvaloniaLoggingDI/AvaloniaLoggingDI.csproj b/CSharp/Applications/AvaloniaLoggingDI/AvaloniaLoggingDI.csproj
deleted file mode 100644
index 4d6e118..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/AvaloniaLoggingDI.csproj
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
- WinExe
- true
- app.manifest
-
-
-
-
-
-
-
- Always
-
-
- Always
-
-
- Always
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CSharp/Applications/AvaloniaLoggingDI/Program.cs b/CSharp/Applications/AvaloniaLoggingDI/Program.cs
deleted file mode 100644
index e266825..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/Program.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using Avalonia;
-using System;
-
-namespace AvaloniaLoggingDI;
-
-internal sealed class Program
-{
- // Initialization code. Don't use any Avalonia, third-party APIs or any
- // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
- // yet and stuff might break.
- [STAThread]
- public static void Main(string[] args)
- => BuildAvaloniaApp()
- .StartWithClassicDesktopLifetime(args);
-
- // Avalonia configuration, don't remove; also used by visual designer.
- public static AppBuilder BuildAvaloniaApp()
- => AppBuilder.Configure()
- .UsePlatformDetect()
- .LogToTrace();
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingDI/Properties/launchSettings.json b/CSharp/Applications/AvaloniaLoggingDI/Properties/launchSettings.json
deleted file mode 100644
index ef5f09f..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/Properties/launchSettings.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "profiles": {
- "Development": {
- "commandName": "Project",
- "environmentVariables": {
- "DOTNET_ENVIRONMENT": "Development"
- }
- },
- "Staging": {
- "commandName": "Project",
- "environmentVariables": {
- "DOTNET_ENVIRONMENT": "Staging"
- }
- },
- "Production": {
- "commandName": "Project"
- }
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingDI/ViewLocator.cs b/CSharp/Applications/AvaloniaLoggingDI/ViewLocator.cs
deleted file mode 100644
index 39722d7..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/ViewLocator.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using Avalonia.Controls;
-using Avalonia.Controls.Templates;
-using AvaloniaLoggingDI.ViewModels;
-using System;
-using System.Diagnostics.CodeAnalysis;
-
-namespace AvaloniaLoggingDI;
-//
-/// Given a view model, returns the corresponding view if possible.
-///
-[RequiresUnreferencedCode(
- "Default implementation of ViewLocator involves reflection which may be trimmed away.",
- Url = "https://docs.avaloniaui.net/docs/concepts/view-locator")]
-public class ViewLocator : IDataTemplate
-{
- public Control? Build(object? param)
- {
- if (param is null)
- return null;
-
- var name = param.GetType().FullName!.Replace("ViewModel", "View", StringComparison.Ordinal);
- var type = Type.GetType(name);
-
- if (type != null)
- {
- return (Control)Activator.CreateInstance(type)!;
- }
-
- return new TextBlock { Text = "Not Found: " + name };
- }
-
- public bool Match(object? data)
- {
- return data is ViewModelBase;
- }
-}
diff --git a/CSharp/Applications/AvaloniaLoggingDI/ViewModels/MainViewModel.cs b/CSharp/Applications/AvaloniaLoggingDI/ViewModels/MainViewModel.cs
deleted file mode 100644
index 39b2502..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/ViewModels/MainViewModel.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using LogViewer.Core.ViewModels;
-
-namespace AvaloniaLoggingDI.ViewModels;
-
-public class MainViewModel(LogViewerControlViewModel logViewer) : ViewModelBase
-{
-
- #region Constructor
-
- #endregion
-
- #region Properties
-
- public LogViewerControlViewModel LogViewer { get; } = logViewer;
-
- #endregion
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingDI/ViewModels/ViewModelBase.cs b/CSharp/Applications/AvaloniaLoggingDI/ViewModels/ViewModelBase.cs
deleted file mode 100644
index b13057b..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/ViewModels/ViewModelBase.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-
-namespace AvaloniaLoggingDI.ViewModels;
-
-public class ViewModelBase : ObservableObject
-{
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingDI/Views/MainWindow.axaml b/CSharp/Applications/AvaloniaLoggingDI/Views/MainWindow.axaml
deleted file mode 100644
index 7ec7dbf..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/Views/MainWindow.axaml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingDI/Views/MainWindow.axaml.cs b/CSharp/Applications/AvaloniaLoggingDI/Views/MainWindow.axaml.cs
deleted file mode 100644
index cbfeaba..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/Views/MainWindow.axaml.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using Avalonia.Controls;
-
-namespace AvaloniaLoggingDI.Views;
-
-public partial class MainWindow : Window
-{
- public MainWindow() => InitializeComponent();
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingDI/app.manifest b/CSharp/Applications/AvaloniaLoggingDI/app.manifest
deleted file mode 100644
index e0ce8d0..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/app.manifest
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CSharp/Applications/AvaloniaLoggingDI/appsettings.Development.json b/CSharp/Applications/AvaloniaLoggingDI/appsettings.Development.json
deleted file mode 100644
index 852dfae..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/appsettings.Development.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Trace",
- "System.Net.Http.HttpClient": "Trace"
- }
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingDI/appsettings.Production.json b/CSharp/Applications/AvaloniaLoggingDI/appsettings.Production.json
deleted file mode 100644
index 8936027..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/appsettings.Production.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Warning",
- "System.Net.Http.HttpClient": "Warning"
- }
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingDI/appsettings.json b/CSharp/Applications/AvaloniaLoggingDI/appsettings.json
deleted file mode 100644
index d122a3e..0000000
--- a/CSharp/Applications/AvaloniaLoggingDI/appsettings.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "System.Net.Http.HttpClient": "Information"
- }
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/App.axaml b/CSharp/Applications/AvaloniaLoggingNoDI/App.axaml
deleted file mode 100644
index dc9b28d..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/App.axaml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/App.axaml.cs b/CSharp/Applications/AvaloniaLoggingNoDI/App.axaml.cs
deleted file mode 100644
index 4f78c64..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/App.axaml.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using Avalonia;
-using Avalonia.Controls.ApplicationLifetimes;
-using Avalonia.Data.Core;
-using Avalonia.Data.Core.Plugins;
-using Avalonia.Markup.Xaml;
-using AvaloniaLoggingNoDI.Views;
-using System.Linq;
-
-namespace AvaloniaLoggingNoDI;
-
-public partial class App : Application
-{
- public override void Initialize()
- {
- AvaloniaXamlLoader.Load(this);
- }
-
- public override void OnFrameworkInitializationCompleted()
- {
- if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
- {
- // Avoid duplicate validations from both Avalonia and the CommunityToolkit.
- // More info: https://docs.avaloniaui.net/docs/guides/development-guides/data-validation#manage-validationplugins
- DisableAvaloniaDataAnnotationValidation();
- desktop.MainWindow = new MainWindow();
- }
-
- base.OnFrameworkInitializationCompleted();
- }
- private static void DisableAvaloniaDataAnnotationValidation()
- {
- // Get an array of plugins to remove
- var dataValidationPluginsToRemove =
- BindingPlugins.DataValidators.OfType().ToArray();
-
- // remove each entry found
- foreach (var plugin in dataValidationPluginsToRemove)
- {
- BindingPlugins.DataValidators.Remove(plugin);
- }
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/Assets/avalonia-logo.ico b/CSharp/Applications/AvaloniaLoggingNoDI/Assets/avalonia-logo.ico
deleted file mode 100644
index f7da8bb..0000000
Binary files a/CSharp/Applications/AvaloniaLoggingNoDI/Assets/avalonia-logo.ico and /dev/null differ
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/AvaloniaLoggingNoDI.csproj b/CSharp/Applications/AvaloniaLoggingNoDI/AvaloniaLoggingNoDI.csproj
deleted file mode 100644
index c7ed33c..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/AvaloniaLoggingNoDI.csproj
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
- WinExe
- true
- app.manifest
-
-
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/DataStores/MainControlsDataStore.cs b/CSharp/Applications/AvaloniaLoggingNoDI/DataStores/MainControlsDataStore.cs
deleted file mode 100644
index 3d8ab88..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/DataStores/MainControlsDataStore.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using LogViewer.Core;
-using LogDataStore = LogViewer.Avalonia.Logging.LogDataStore;
-
-namespace AvaloniaLoggingNoDI.DataStores;
-
-// Application-wide shared instance of the LogDataStore logging entries
-public static class MainControlsDataStore
-{
- public static ILogDataStore DataStore { get; } = new LogDataStore();
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/Extensions/LoggerExtension.cs b/CSharp/Applications/AvaloniaLoggingNoDI/Extensions/LoggerExtension.cs
deleted file mode 100644
index d67fd0c..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/Extensions/LoggerExtension.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-using LogViewer.Core;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.DependencyInjection.Extensions;
-using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Logging.Configuration;
-using MsLogger.Core;
-using AvaloniaLoggingNoDI.DataStores;
-
-namespace AvaloniaLoggingNoDI.Extensions;
-
-public static class LoggerExtension
-{
- public static ILoggingBuilder AddDataStoreLogger(this ILoggingBuilder builder)
- {
- builder.AddConfiguration();
-
- // We need to use a shared instance of the DataStore to pass to the LogViewerControl
- builder.Services.AddSingleton(MainControlsDataStore.DataStore);
- builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton());
- return builder;
- }
-
- public static ILoggingBuilder AddDataStoreLogger(this ILoggingBuilder builder, Action configure)
- {
- builder.AddDataStoreLogger();
- builder.Services.Configure(configure);
- return builder;
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/Helpers/AppSettings.cs b/CSharp/Applications/AvaloniaLoggingNoDI/Helpers/AppSettings.cs
deleted file mode 100644
index 52ad7ce..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/Helpers/AppSettings.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-using Microsoft.Extensions.Configuration;
-using System;
-using System.IO;
-
-namespace AvaloniaLoggingNoDI.Helpers;
-
-public class AppSettings
-{
- #region Constructors
- public AppSettings(IConfigurationSection configSection, string? key = null)
- {
- ConfigSection = configSection;
-
- // ReSharper disable once VirtualMemberCallInConstructor
- GetValue(key);
- }
- #endregion
-
- #region Properties
- protected static AppSettings? AppSetting { get; private set; }
-
- // ReSharper disable once StaticMemberInGenericType
- protected static IConfigurationSection? ConfigSection { get; private set; }
-
- public TOption? Value { get; set; }
- #endregion
-
- #region Methods
-#pragma warning disable CA1000 // Do not declare static members on generic types
- public static TOption? Current(string section, string? key = null)
- {
- AppSetting = GetCurrentSettings(section, key);
- return AppSetting.Value;
- }
-
-
- public static AppSettings GetCurrentSettings(string section, string? key = null)
-#pragma warning restore CA1000 // Do not declare static members on generic types
- {
- string env = Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT") ?? "Production";
-
- IConfigurationBuilder builder = new ConfigurationBuilder()
- .SetBasePath(Directory.GetCurrentDirectory())
- .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
- .AddJsonFile($"appsettings.{env}.json", optional: true, reloadOnChange: true)
- .AddEnvironmentVariables();
-
- IConfigurationRoot configuration = builder.Build();
-
- if (string.IsNullOrEmpty(section))
- section = "AppSettings"; // default
-
- AppSettings settings = new AppSettings(configuration.GetSection(section), key);
-
- return settings;
- }
-
- protected virtual void GetValue(string? key)
- {
- if (key is null)
- {
- // no key, so must be a class/strut object
- Value = Activator.CreateInstance();
- ConfigSection!.Bind(Value);
- return;
- }
-
- Type optionType = typeof(TOption);
-
- if ((optionType == typeof(string) ||
- optionType == typeof(int) ||
- optionType == typeof(long) ||
- optionType == typeof(decimal) ||
- optionType == typeof(float) ||
- optionType == typeof(double))
- && ConfigSection != null)
- {
- // we must be retrieving a value
- Value = ConfigSection.GetValue(key);
- return;
- }
-
- // Could not find a supported type
- throw new InvalidCastException($"Type {typeof(TOption).Name} is invalid");
- }
-
- #endregion
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/Helpers/LoggingHelper.cs b/CSharp/Applications/AvaloniaLoggingNoDI/Helpers/LoggingHelper.cs
deleted file mode 100644
index 9104868..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/Helpers/LoggingHelper.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-using System;
-using System.Drawing;
-using Microsoft.Extensions.Logging;
-using AvaloniaLoggingNoDI.Extensions;
-using System.Diagnostics;
-
-namespace AvaloniaLoggingNoDI.Helpers;
-
-// application-wide DataStoreLogger Factory ... returns a wired up Logger instance
-public static class LoggingHelper
-{
- #region Constructors
-
- static LoggingHelper()
- {
- // retrieve the log level from 'appsettings'
- string value = AppSettings.Current("Logging:LogLevel", "Default") ?? "Information";
- var success = Enum.TryParse(value, out LogLevel logLevel);
- Debug.Assert(success, $"Failed to parse log level from appsettings. Value: '{value}'");
- // wire up the loggers
- Factory = LoggerFactory.Create(builder => builder
-
- // visual debugging tools
- //.AddDataStoreLogger()
-
- // uncomment to use custom logging colors (note: System.Drawing namespace)
- //
- .AddDataStoreLogger(options =>
- {
- options.Colors[LogLevel.Trace] = new()
- {
- Foreground = Color.White,
- Background = Color.DarkGray
- };
-
- options.Colors[LogLevel.Debug] = new()
- {
- Foreground = Color.White,
- Background = Color.Gray
- };
-
- options.Colors[LogLevel.Information] = new()
- {
- Foreground = Color.White,
- Background = Color.DodgerBlue
- };
-
- options.Colors[LogLevel.Warning] = new()
- {
- Foreground = Color.White,
- Background = Color.Orchid
- };
- })
-
- // examples of adding other loggers...
- .AddSimpleConsole(options =>
- {
- options.SingleLine = true;
- options.TimestampFormat = "hh:mm:ss ";
- })
-
- // note:
- // * The IDE will automatically add the Debugger Logger, even though not visible
- // * Adding the DebugLogger is useful for remote debugging
- //.AddDebug()
-
- // set minimum log level from 'appsettings'
- .SetMinimumLevel(logLevel));
- }
-
- #endregion
-
- #region Properties
-
- public static ILoggerFactory Factory { get; }
-
- #endregion
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/Program.cs b/CSharp/Applications/AvaloniaLoggingNoDI/Program.cs
deleted file mode 100644
index 319faa8..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/Program.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using Avalonia;
-using System;
-
-namespace AvaloniaLoggingNoDI;
-
-internal sealed class Program
-{
- // Initialization code. Don't use any Avalonia, third-party APIs or any
- // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
- // yet and stuff might break.
- [STAThread]
- public static void Main(string[] args)
- => BuildAvaloniaApp()
- .StartWithClassicDesktopLifetime(args);
-
- // Avalonia configuration, don't remove; also used by visual designer.
- public static AppBuilder BuildAvaloniaApp()
- => AppBuilder.Configure()
- .UsePlatformDetect()
- .LogToTrace();
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/Properties/launchSettings.json b/CSharp/Applications/AvaloniaLoggingNoDI/Properties/launchSettings.json
deleted file mode 100644
index ef5f09f..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/Properties/launchSettings.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "profiles": {
- "Development": {
- "commandName": "Project",
- "environmentVariables": {
- "DOTNET_ENVIRONMENT": "Development"
- }
- },
- "Staging": {
- "commandName": "Project",
- "environmentVariables": {
- "DOTNET_ENVIRONMENT": "Staging"
- }
- },
- "Production": {
- "commandName": "Project"
- }
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/Views/MainWindow.axaml b/CSharp/Applications/AvaloniaLoggingNoDI/Views/MainWindow.axaml
deleted file mode 100644
index b57f4fa..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/Views/MainWindow.axaml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/Views/MainWindow.axaml.cs b/CSharp/Applications/AvaloniaLoggingNoDI/Views/MainWindow.axaml.cs
deleted file mode 100644
index d263681..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/Views/MainWindow.axaml.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using Avalonia.Controls;
-using AvaloniaLoggingNoDI.DataStores;
-using AvaloniaLoggingNoDI.Helpers;
-using LogViewer.Core;
-using Microsoft.Extensions.Logging;
-using RandomLogging.Service;
-using System;
-using System.Reflection;
-using System.Threading;
-
-namespace AvaloniaLoggingNoDI.Views;
-
-public partial class MainWindow : Window, ILogDataStoreCore
-{
- public MainWindow()
- {
- InitializeComponent();
-
- // Initialize service and pass in the Logger
- RandomLoggingService service = new(new Logger(LoggingHelper.Factory));
-
- // Get the Launch mode
- bool isDevelopment = string.Equals(Environment.GetEnvironmentVariable("DOTNET_MODIFIABLE_ASSEMBLIES"), "debug",
- StringComparison.OrdinalIgnoreCase);
-
- // initialize a logger & EventId
- Logger logger = new Logger(LoggingHelper.Factory);
- EventId eventId = new EventId(id: 0, name: Assembly.GetEntryAssembly()!.GetName().Name);
-
- // log a test pattern for each log level
- logger.TestPattern(eventId: eventId);
-
- // log that we have started...
- logger.Emit(eventId, LogLevel.Information, $"Running in {(isDevelopment ? "Debug" : "Release")} mode");
-
- // Start generating log entries
- _ = service.StartAsync(CancellationToken.None);
-
- // manually wire up the logging to the view ... the control will show backlog entries...
- DataStore = MainControlsDataStore.DataStore;
-
- // we can't bind the controls' DataContext to a static object, so assign the DataStore to the Window
- // and pass a reference to the Window itself
- LogViewerControl.DataContext = this;
- }
-
- public ILogDataStore DataStore { get; init; }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/app.manifest b/CSharp/Applications/AvaloniaLoggingNoDI/app.manifest
deleted file mode 100644
index e0ce8d0..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/app.manifest
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/appsettings.Development.json b/CSharp/Applications/AvaloniaLoggingNoDI/appsettings.Development.json
deleted file mode 100644
index 852dfae..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/appsettings.Development.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Trace",
- "System.Net.Http.HttpClient": "Trace"
- }
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/appsettings.Production.json b/CSharp/Applications/AvaloniaLoggingNoDI/appsettings.Production.json
deleted file mode 100644
index 8936027..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/appsettings.Production.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Warning",
- "System.Net.Http.HttpClient": "Warning"
- }
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/appsettings.json b/CSharp/Applications/AvaloniaLoggingNoDI/appsettings.json
deleted file mode 100644
index d122a3e..0000000
--- a/CSharp/Applications/AvaloniaLoggingNoDI/appsettings.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "System.Net.Http.HttpClient": "Information"
- }
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogDI/App.axaml b/CSharp/Applications/AvaloniaSerilogDI/App.axaml
deleted file mode 100644
index c47bc6e..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/App.axaml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogDI/App.axaml.cs b/CSharp/Applications/AvaloniaSerilogDI/App.axaml.cs
deleted file mode 100644
index ea5fd60..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/App.axaml.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-using Avalonia;
-using Avalonia.Controls.ApplicationLifetimes;
-using Avalonia.Data.Core.Plugins;
-using Avalonia.Markup.Xaml;
-using AvaloniaSerilogDI.ViewModels;
-using AvaloniaSerilogDI.Views;
-using LogViewer.Avalonia;
-using LogViewer.Core;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Logging;
-using MsBox.Avalonia;
-using MsBox.Avalonia.Enums;
-using RandomLogging.Service;
-using Serilog;
-using Serilog.Sinks.LogView.Core;
-using System;
-using System.Globalization;
-using System.Linq;
-using System.Reflection;
-using System.Threading;
-using Icon = MsBox.Avalonia.Enums.Icon;
-namespace AvaloniaSerilogDI;
-
-public static class ServicesExtension
-{
- public static TModel? TryGetService(this IServiceProvider serviceProvider) where TModel : class
- {
- try
- {
- return (TModel?)serviceProvider.GetService(typeof(TModel));
- }
- catch (ObjectDisposedException)
- {
- // ignore as we do not care...
- }
-
- return default;
- }
-}
-public partial class App : Application
-{
- #region Constructors
-
- public override void Initialize()
- => AvaloniaXamlLoader.Load(this);
-
- #endregion
-
-
- private IHost? Host {get; set;}
- private CancellationTokenSource? CancellationTokenSource { get; set;}
-
-
- #region Methods
-
- public override void OnFrameworkInitializationCompleted()
- {
- if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
- {
- // Avoid duplicate validations from both Avalonia and the CommunityToolkit.
- // More info: https://docs.avaloniaui.net/docs/guides/development-guides/data-validation#manage-validationplugins
- DisableAvaloniaDataAnnotationValidation();
- // catch all unhandled errors
- AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
-
- HostApplicationBuilder builder = Microsoft.Extensions.Hosting.Host.CreateApplicationBuilder();
-
- builder
- // Register the Random Logging Service
- .AddRandomBackgroundService()
-
- // visual debugging tools
- .AddLogViewer();
-
- IServiceCollection services = builder.Services;
-
- // Serilog Logger
-
- // Azure: https://devblogs.microsoft.com/dotnet/asp-net-core-logging/
- // ApplicationInsights: https://github.com/serilog-contrib/serilog-sinks-applicationinsights
- // AmazonCloudWatch: https://blog.ivankahl.com/logging-dotnet-to-aws-cloudwatch-using-serilog/
- // video: https://www.youtube.com/watch?v=nVAkSBpsuTk (How Structured Logging With Serilog Can Make Your Life Easier)
- // video: https://www.youtube.com/watch?v=_iryZxv8Rxw (C# Logging with Serilog and Seq - Structured Logging Made Easy)
- // ps: docker run -d --restart unless-stopped --name seq -e ACCEPT_EULA=Y -v c:\WIP\LogData:/data -p 8081:80 datalust/seq:latest
- // docker rmi datalust/seq --force
-
- // ref: https://stackoverflow.com/questions/66304596/how-to-dependency-inject-serilog-into-the-rest-of-my-classes-in-net-console-app
- services.AddLogging(configure: cfg =>
- {
- Log.Logger = new LoggerConfiguration()
- .ReadFrom.Configuration(builder.Configuration)
- .WriteTo.DataStoreLoggerSink( dataStoreProvider: () => Host?.Services.TryGetService()!,formatProvider: CultureInfo.InvariantCulture)
- .CreateLogger();
-
- cfg.ClearProviders().AddSerilog(Log.Logger);
- });
-
- services
- .AddSingleton()
- .AddSingleton(service => new MainWindow
- {
- DataContext = service.GetRequiredService()
- });
-
- Host = builder.Build();
- CancellationTokenSource = new();
-
- try
- {
- LogStartingMode();
-
- // set and show
- desktop.MainWindow = Host.Services.GetRequiredService();
- desktop.ShutdownRequested += OnShutdownRequested;
-
- // startup background services
- _ = Host.StartAsync(CancellationTokenSource.Token);
- }
- catch (OperationCanceledException)
- {
- // skip
- }
- catch (Exception ex)
- {
- Log.Fatal(ex, "Application terminated unexpectedly");
-
- ShowMessageBox("Unhandled Error", ex.Message);
-
- CleanUp();
- return;
- }
- }
-
- base.OnFrameworkInitializationCompleted();
- }
- private static void DisableAvaloniaDataAnnotationValidation()
- {
- // Get an array of plugins to remove
- var dataValidationPluginsToRemove = BindingPlugins.DataValidators.OfType().ToArray();
-
- // remove each entry found
- foreach (var plugin in dataValidationPluginsToRemove)
- {
- BindingPlugins.DataValidators.Remove(plugin);
- }
- }
- private void OnShutdownRequested(object? sender, ShutdownRequestedEventArgs e)
- => CleanUp();
-
- private void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
- {
- Exception exception = (Exception)e.ExceptionObject;
-
- Log.Fatal(exception, "Application terminated unexpectedly");
- ShowMessageBox("Unhandled Error", exception.Message);
-
- CleanUp();
- }
-
- private static void ShowMessageBox(string title, string message)
- {
- var box = MessageBoxManager.GetMessageBoxStandard(
- "Exception",
- text: message,
- ButtonEnum.Ok,
- Icon.Stop
- );
- _ = box.ShowAsync().GetAwaiter();
- }
- private void LogStartingMode()
- {
- // Get the Launch mode
- bool isDevelopment = string.Equals(Environment.GetEnvironmentVariable("DOTNET_MODIFIABLE_ASSEMBLIES"), "debug",
- StringComparison.OrdinalIgnoreCase);
-
- // initialize a logger & EventId
- ILogger logger = Host!.Services.GetRequiredService>();
- EventId eventId = new(id: 0, name: Assembly.GetEntryAssembly()!.GetName().Name);
-
- // log a test pattern for each log level
- logger.TestPattern(eventId: eventId);
-
- // log that we have started...
- logger.Emit(eventId, LogLevel.Information, $"Running in {(isDevelopment ? "Debug" : "Release")} mode");
- }
-
- private void CleanUp()
- {
- // tell the background services that we are shutting down
- _ = Host?.StopAsync(CancellationTokenSource?.Token ?? CancellationToken.None);
-
- // flush logs
- Log.CloseAndFlush();
- }
-
- #endregion
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogDI/Assets/avalonia-logo.ico b/CSharp/Applications/AvaloniaSerilogDI/Assets/avalonia-logo.ico
deleted file mode 100644
index f7da8bb..0000000
Binary files a/CSharp/Applications/AvaloniaSerilogDI/Assets/avalonia-logo.ico and /dev/null differ
diff --git a/CSharp/Applications/AvaloniaSerilogDI/AvaloniaSerilogDI.csproj b/CSharp/Applications/AvaloniaSerilogDI/AvaloniaSerilogDI.csproj
deleted file mode 100644
index 1c02d58..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/AvaloniaSerilogDI.csproj
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
- WinExe
- true
- app.manifest
-
-
-
-
-
-
-
-
-
-
- Always
-
-
- Always
-
-
- Always
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CSharp/Applications/AvaloniaSerilogDI/Program.cs b/CSharp/Applications/AvaloniaSerilogDI/Program.cs
deleted file mode 100644
index da40120..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/Program.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Avalonia;
-using System;
-
-namespace AvaloniaSerilogDI;
-
-internal sealed class Program
-{
- // Initialization code. Don't use any Avalonia, third-party APIs or any
- // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
- // yet and stuff might break.
- [STAThread]
- public static void Main(string[] args) => BuildAvaloniaApp()
- .StartWithClassicDesktopLifetime(args);
-
- // Avalonia configuration, don't remove; also used by visual designer.
- public static AppBuilder BuildAvaloniaApp()
- => AppBuilder.Configure()
- .UsePlatformDetect()
- .LogToTrace();
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogDI/Properties/launchSettings.json b/CSharp/Applications/AvaloniaSerilogDI/Properties/launchSettings.json
deleted file mode 100644
index ef5f09f..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/Properties/launchSettings.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "profiles": {
- "Development": {
- "commandName": "Project",
- "environmentVariables": {
- "DOTNET_ENVIRONMENT": "Development"
- }
- },
- "Staging": {
- "commandName": "Project",
- "environmentVariables": {
- "DOTNET_ENVIRONMENT": "Staging"
- }
- },
- "Production": {
- "commandName": "Project"
- }
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogDI/ViewLocator.cs b/CSharp/Applications/AvaloniaSerilogDI/ViewLocator.cs
deleted file mode 100644
index bf3d20e..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/ViewLocator.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using Avalonia.Controls;
-using Avalonia.Controls.Templates;
-using AvaloniaSerilogDI.ViewModels;
-using System;
-using System.Diagnostics.CodeAnalysis;
-
-namespace AvaloniaSerilogDI;
-//
-/// Given a view model, returns the corresponding view if possible.
-///
-[RequiresUnreferencedCode(
- "Default implementation of ViewLocator involves reflection which may be trimmed away.",
- Url = "https://docs.avaloniaui.net/docs/concepts/view-locator")]
-public class ViewLocator : IDataTemplate
-{
- public Control? Build(object? param)
- {
- if (param is null)
- return null;
-
- var name = param.GetType().FullName!.Replace("ViewModel", "View", StringComparison.Ordinal);
- var type = Type.GetType(name);
-
- if (type != null)
- {
- return (Control)Activator.CreateInstance(type)!;
- }
-
- return new TextBlock { Text = "Not Found: " + name };
- }
-
- public bool Match(object? data)
- {
- return data is ViewModelBase;
- }
-}
diff --git a/CSharp/Applications/AvaloniaSerilogDI/ViewModels/MainViewModel.cs b/CSharp/Applications/AvaloniaSerilogDI/ViewModels/MainViewModel.cs
deleted file mode 100644
index 13eba5e..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/ViewModels/MainViewModel.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using LogViewer.Core.ViewModels;
-
-namespace AvaloniaSerilogDI.ViewModels;
-
-public class MainViewModel(LogViewerControlViewModel logViewer) : ViewModelBase
-{
-
- #region Constructor
-
- #endregion
-
- #region Properties
-
- public LogViewerControlViewModel LogViewer { get; } = logViewer;
-
- #endregion
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogDI/ViewModels/ViewModelBase.cs b/CSharp/Applications/AvaloniaSerilogDI/ViewModels/ViewModelBase.cs
deleted file mode 100644
index db5a028..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/ViewModels/ViewModelBase.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-
-namespace AvaloniaSerilogDI.ViewModels;
-
-public class ViewModelBase : ObservableObject
-{
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogDI/Views/MainWindow.axaml b/CSharp/Applications/AvaloniaSerilogDI/Views/MainWindow.axaml
deleted file mode 100644
index df4a2b7..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/Views/MainWindow.axaml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogDI/Views/MainWindow.axaml.cs b/CSharp/Applications/AvaloniaSerilogDI/Views/MainWindow.axaml.cs
deleted file mode 100644
index 6213239..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/Views/MainWindow.axaml.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using Avalonia.Controls;
-
-namespace AvaloniaSerilogDI.Views;
-
-public partial class MainWindow : Window
-{
- public MainWindow() => InitializeComponent();
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogDI/app.manifest b/CSharp/Applications/AvaloniaSerilogDI/app.manifest
deleted file mode 100644
index e0ce8d0..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/app.manifest
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CSharp/Applications/AvaloniaSerilogDI/appsettings.Development.json b/CSharp/Applications/AvaloniaSerilogDI/appsettings.Development.json
deleted file mode 100644
index 3d89069..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/appsettings.Development.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Trace",
- "System.Net.Http.HttpClient": "Trace"
- }
- },
- "Serilog": {
- "Using": [ "Serilog.Sinks.File" ],
- "LevelSwitches": { "controlSwitch": "Verbose" },
- "MinimumLevel": {
- "Default": "Verbose",
- "Override": {
- "Microsoft": "Verbose"
- }
- },
- "WriteTo": [
- {
- "Name": "Console",
- "Args": {
- "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {EventId} | {Message:lj} {NewLine}{Exception}"
- }
- },
- {
- "Name": "File",
- "Args": {
- "path": "c:\\WIP\\LogData\\log-.txt",
- "rollingInterval": "Day",
- "rollOnFileSizeLimit": true,
- "outputTemplate": "{Timestamp:G} {Message}{NewLine:1}{Exception:1}"
- }
- },
- {
- "Name": "File",
- "Args": {
- "path": "c:\\WIP\\LogData\\log-.json",
- "rollingInterval": "Day",
- "rollOnFileSizeLimit": true,
- "formatter": "Serilog.Formatting.Json.JsonFormatter"
- }
- }
- ],
- "Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ]
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogDI/appsettings.Production.json b/CSharp/Applications/AvaloniaSerilogDI/appsettings.Production.json
deleted file mode 100644
index a85adcc..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/appsettings.Production.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Warning",
- "System.Net.Http.HttpClient": "Warning"
- }
- },
- "Serilog": {
- "Using": [ "Serilog.Sinks.File" ],
- "LevelSwitches": { "controlSwitch": "Warning" },
- "MinimumLevel": {
- "Default": "Warning",
- "Override": {
- "Microsoft": "Warning"
- }
- },
-
- "WriteTo": [
- {
- "Name": "Console",
- "Args": {
- "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {EventId.Name} | {Message:lj} {NewLine}{Exception}"
- }
- },
- {
- "Name": "File",
- "Args": {
- "path": "c:\\WIP\\LogData\\log-.txt",
- "rollingInterval": "Day",
- "rollOnFileSizeLimit": true,
- "outputTemplate": "{Timestamp:G} {Message}{NewLine:1}{Exception:1}"
- }
- },
- {
- "Name": "File",
- "Args": {
- "path": "c:\\WIP\\LogData\\log-.json",
- "rollingInterval": "Day",
- "rollOnFileSizeLimit": true,
- "formatter": "Serilog.Formatting.Json.JsonFormatter"
- }
- }
- ],
- "Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ]
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogDI/appsettings.json b/CSharp/Applications/AvaloniaSerilogDI/appsettings.json
deleted file mode 100644
index 08d0a44..0000000
--- a/CSharp/Applications/AvaloniaSerilogDI/appsettings.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "Logging": {
- "LogLevel": {
- "Default": "Information",
- "System.Net.Http.HttpClient": "Information"
- }
- },
- "Serilog": {
- "Using": [ "Serilog.Sinks.File" ],
- "LevelSwitches": { "controlSwitch": "Information" },
- "MinimumLevel": {
- "Default": "Information",
- "Override": {
- "Microsoft": "Information"
- }
- },
-
- "WriteTo": [
- {
- "Name": "Console",
- "Args": {
- "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {EventId.Name} | {Message:lj} {NewLine}{Exception}"
- }
- },
- {
- "Name": "File",
- "Args": {
- "path": "c:\\WIP\\LogData\\log-.txt",
- "rollingInterval": "Day",
- "rollOnFileSizeLimit": true,
- "outputTemplate": "{Timestamp:G} {Message}{NewLine:1}{Exception:1}"
- }
- },
- {
- "Name": "File",
- "Args": {
- "path": "c:\\WIP\\LogData\\log-.json",
- "rollingInterval": "Day",
- "rollOnFileSizeLimit": true,
- "formatter": "Serilog.Formatting.Json.JsonFormatter"
- }
- }
- ],
- "Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ]
- }
-}
\ No newline at end of file
diff --git a/CSharp/Applications/AvaloniaSerilogNoDI/AvaloniaSerilogNoDI.csproj b/CSharp/Applications/AvaloniaSerilogNoDI/AvaloniaSerilogNoDI.csproj
index b5d54b3..8fe6e51 100644
--- a/CSharp/Applications/AvaloniaSerilogNoDI/AvaloniaSerilogNoDI.csproj
+++ b/CSharp/Applications/AvaloniaSerilogNoDI/AvaloniaSerilogNoDI.csproj
@@ -45,6 +45,5 @@
-
diff --git a/CSharp/Applications/AvaloniaSerilogNoDI/DataStores/MainControlsDataStore.cs b/CSharp/Applications/AvaloniaSerilogNoDI/DataStores/MainControlsDataStore.cs
index 5ea1ac2..afff482 100644
--- a/CSharp/Applications/AvaloniaSerilogNoDI/DataStores/MainControlsDataStore.cs
+++ b/CSharp/Applications/AvaloniaSerilogNoDI/DataStores/MainControlsDataStore.cs
@@ -1,4 +1,4 @@
-using LogViewer.Core;
+using Serilog.Sinks.LogView.Core.Logging;
using LogDataStore = LogViewer.Avalonia.Logging.LogDataStore;
namespace AvaloniaSerilogNoDI.DataStores;
diff --git a/CSharp/Applications/AvaloniaSerilogNoDI/Helpers/LoggingHelper.cs b/CSharp/Applications/AvaloniaSerilogNoDI/Helpers/LoggingHelper.cs
index a62061d..0529b62 100644
--- a/CSharp/Applications/AvaloniaSerilogNoDI/Helpers/LoggingHelper.cs
+++ b/CSharp/Applications/AvaloniaSerilogNoDI/Helpers/LoggingHelper.cs
@@ -2,7 +2,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Serilog;
-using Serilog.Sinks.LogView.Core;
+using Serilog.Sinks.LogView.Core.Extensions;
using System;
using System.Drawing;
using System.Globalization;
diff --git a/CSharp/Applications/AvaloniaSerilogNoDI/MainWindow.axaml.cs b/CSharp/Applications/AvaloniaSerilogNoDI/MainWindow.axaml.cs
index 3af7dd6..875dfd7 100644
--- a/CSharp/Applications/AvaloniaSerilogNoDI/MainWindow.axaml.cs
+++ b/CSharp/Applications/AvaloniaSerilogNoDI/MainWindow.axaml.cs
@@ -1,9 +1,9 @@
using Avalonia.Controls;
using AvaloniaSerilogNoDI.DataStores;
using AvaloniaSerilogNoDI.Helpers;
-using LogViewer.Core;
using Microsoft.Extensions.Logging;
using RandomLogging.Service;
+using Serilog.Sinks.LogView.Core.Logging;
using System;
using System.ComponentModel;
using System.Reflection;
diff --git a/CSharp/Background Services/RandomLogging.Service/RandomLogging.Service.csproj b/CSharp/Background Services/RandomLogging.Service/RandomLogging.Service.csproj
index 620aef0..4b28700 100644
--- a/CSharp/Background Services/RandomLogging.Service/RandomLogging.Service.csproj
+++ b/CSharp/Background Services/RandomLogging.Service/RandomLogging.Service.csproj
@@ -10,7 +10,7 @@
-
+
diff --git a/CSharp/Core/LogViewer.Core/ViewModels/LogViewerControlViewModel.cs b/CSharp/Controls/LogViewer.Avalonia/Extensions/LogViewerControlViewModel.cs
similarity index 63%
rename from CSharp/Core/LogViewer.Core/ViewModels/LogViewerControlViewModel.cs
rename to CSharp/Controls/LogViewer.Avalonia/Extensions/LogViewerControlViewModel.cs
index d3b28c8..fe7a3a8 100644
--- a/CSharp/Core/LogViewer.Core/ViewModels/LogViewerControlViewModel.cs
+++ b/CSharp/Controls/LogViewer.Avalonia/Extensions/LogViewerControlViewModel.cs
@@ -1,4 +1,6 @@
-namespace LogViewer.Core.ViewModels;
+using Serilog.Sinks.LogView.Core.Logging;
+
+namespace LogViewer.Avalonia.Extensions;
public class LogViewerControlViewModel(ILogDataStore dataStore) : ILogDataStoreCore
{
diff --git a/CSharp/Controls/LogViewer.Avalonia/Extensions/ServicesExtension.cs b/CSharp/Controls/LogViewer.Avalonia/Extensions/ServicesExtension.cs
index ee9d09b..4cab743 100644
--- a/CSharp/Controls/LogViewer.Avalonia/Extensions/ServicesExtension.cs
+++ b/CSharp/Controls/LogViewer.Avalonia/Extensions/ServicesExtension.cs
@@ -1,10 +1,9 @@
-using LogViewer.Core;
-using LogViewer.Core.ViewModels;
-using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+using Serilog.Sinks.LogView.Core.Logging;
using LogDataStore = LogViewer.Avalonia.Logging.LogDataStore;
-namespace LogViewer.Avalonia;
+namespace LogViewer.Avalonia.Extensions;
public static class ServicesExtension
{
diff --git a/CSharp/Controls/LogViewer.Avalonia/LogViewer.Avalonia.csproj b/CSharp/Controls/LogViewer.Avalonia/LogViewer.Avalonia.csproj
index 244effc..cfef285 100644
--- a/CSharp/Controls/LogViewer.Avalonia/LogViewer.Avalonia.csproj
+++ b/CSharp/Controls/LogViewer.Avalonia/LogViewer.Avalonia.csproj
@@ -19,7 +19,7 @@
-
+
diff --git a/CSharp/Controls/LogViewer.Avalonia/LogViewerControl.axaml.cs b/CSharp/Controls/LogViewer.Avalonia/LogViewerControl.axaml.cs
index e46ec90..d1ba7f7 100644
--- a/CSharp/Controls/LogViewer.Avalonia/LogViewerControl.axaml.cs
+++ b/CSharp/Controls/LogViewer.Avalonia/LogViewerControl.axaml.cs
@@ -1,7 +1,7 @@
using System.Collections.Specialized;
using Avalonia.Controls;
using Avalonia.LogicalTree;
-using LogViewer.Core;
+using Serilog.Sinks.LogView.Core.Logging;
namespace LogViewer.Avalonia;
diff --git a/CSharp/Controls/LogViewer.Avalonia/Logging/LogDataStore.cs b/CSharp/Controls/LogViewer.Avalonia/Logging/LogDataStore.cs
index 5898fea..369a177 100644
--- a/CSharp/Controls/LogViewer.Avalonia/Logging/LogDataStore.cs
+++ b/CSharp/Controls/LogViewer.Avalonia/Logging/LogDataStore.cs
@@ -1,12 +1,13 @@
using Avalonia.Threading;
+using Serilog.Sinks.LogView.Core.Logging;
namespace LogViewer.Avalonia.Logging;
-public class LogDataStore : Core.LogDataStore
+public class LogDataStore : Serilog.Sinks.LogView.Core.Logging.LogDataStore
{
#region Methods
- public override async void AddEntry(Core.LogModel logModel)
+ public override async void AddEntry(LogModel logModel)
=> await Dispatcher.UIThread.InvokeAsync(() => base.AddEntry(logModel));
#endregion
diff --git a/CSharp/Core/LogViewer.Core/LogViewer.Core.csproj b/CSharp/Core/LogViewer.Core/LogViewer.Core.csproj
deleted file mode 100644
index b81e708..0000000
--- a/CSharp/Core/LogViewer.Core/LogViewer.Core.csproj
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- enable
-
-
-
-
-
-
-
diff --git a/CSharp/Core/MsLogger.Core/DataStoreLogger.cs b/CSharp/Core/MsLogger.Core/DataStoreLogger.cs
deleted file mode 100644
index b4e8dc1..0000000
--- a/CSharp/Core/MsLogger.Core/DataStoreLogger.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System.Diagnostics;
-using LogViewer.Core;
-using Microsoft.Extensions.Logging;
-
-namespace MsLogger.Core;
-
-public class DataStoreLogger: ILogger
-{
- // ref: https://learn.microsoft.com/en-us/dotnet/core/extensions/custom-logging-provider
-
- #region Constructor
-
- public DataStoreLogger(string name, Func getCurrentConfig, ILogDataStore dataStore)
- {
- (_name, _getCurrentConfig) = (name, getCurrentConfig);
- _dataStore = dataStore;
- }
-
- #endregion
-
- #region Fields
-
- private readonly ILogDataStore _dataStore;
- private readonly string _name;
- private readonly Func _getCurrentConfig;
-
- #endregion
-
- #region methods
-
- public IDisposable BeginScope(TState state) where TState : notnull => default!;
-
- public bool IsEnabled(LogLevel logLevel) => true;
-
- public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter)
- {
- // check if we are logging for passed log level
- if (!IsEnabled(logLevel))
- return;
-
- DataStoreLoggerConfiguration config = _getCurrentConfig();
-
- _dataStore.AddEntry(new()
- {
- Timestamp = DateTime.UtcNow,
- LogLevel = logLevel,
- // do we override the default EventId if it exists?
- EventId = eventId.Id == 0 && config.EventId != 0 ? config.EventId : eventId,
- State = state,
- Exception = exception?.Message ?? (logLevel == LogLevel.Error ? state?.ToString() ?? "" : ""),
- Color = config.Colors[logLevel],
- });
-
- Debug.WriteLine($"--- [{logLevel.ToString()[..3]}] {_name} - {formatter(state, exception!)}");
- }
-
- #endregion
-}
\ No newline at end of file
diff --git a/CSharp/Core/MsLogger.Core/DataStoreLoggerProvider.cs b/CSharp/Core/MsLogger.Core/DataStoreLoggerProvider.cs
deleted file mode 100644
index cddb603..0000000
--- a/CSharp/Core/MsLogger.Core/DataStoreLoggerProvider.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System.Collections.Concurrent;
-using LogViewer.Core;
-using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Options;
-
-namespace MsLogger.Core;
-
-public class DataStoreLoggerProvider: ILoggerProvider
-{
-
- #region Constructor
-
- public DataStoreLoggerProvider(IOptionsMonitor config, ILogDataStore dataStore)
- {
- DataStore = dataStore;
- _currentConfig = config.CurrentValue;
- OnChangeToken = config.OnChange(updatedConfig => _currentConfig = updatedConfig);
- }
-
- #endregion
-
- #region fields
-
- private DataStoreLoggerConfiguration _currentConfig;
-
- private IDisposable? OnChangeToken { get; }
- protected ILogDataStore DataStore { get; }
-
- protected ConcurrentDictionary Loggers { get; } = new();
-
- #endregion
-
- #region Methods
-
- public ILogger CreateLogger(string categoryName)
- => Loggers.GetOrAdd(categoryName, name => new DataStoreLogger(name, GetCurrentConfig, DataStore));
-
- protected DataStoreLoggerConfiguration GetCurrentConfig()
- => _currentConfig;
-
- public void Dispose()
- {
- GC.SuppressFinalize(this);
- Loggers.Clear();
- OnChangeToken?.Dispose();
- }
-
- #endregion
-}
\ No newline at end of file
diff --git a/CSharp/Core/MsLogger.Core/Extensions/ServicesExtension.cs b/CSharp/Core/MsLogger.Core/Extensions/ServicesExtension.cs
deleted file mode 100644
index 3a1bdac..0000000
--- a/CSharp/Core/MsLogger.Core/Extensions/ServicesExtension.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using LogViewer.Core;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.DependencyInjection.Extensions;
-using Microsoft.Extensions.Logging;
-
-namespace MsLogger.Core;
-
-public static class ServicesExtension
-{
- public static ILoggingBuilder AddDefaultDataStoreLogger(this ILoggingBuilder builder)
- {
- builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton());
- return builder;
- }
-
- public static ILoggingBuilder AddDefaultDataStoreLogger(this ILoggingBuilder builder, Action configure)
- {
- builder.AddDefaultDataStoreLogger();
- builder.Services.Configure(configure);
- return builder;
- }
-}
\ No newline at end of file
diff --git a/CSharp/Core/MsLogger.Core/MsLogger.Core.csproj b/CSharp/Core/MsLogger.Core/MsLogger.Core.csproj
deleted file mode 100644
index 6835542..0000000
--- a/CSharp/Core/MsLogger.Core/MsLogger.Core.csproj
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
- enable
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CSharp/Core/Mvvm.Core/Mvvm.Core.csproj b/CSharp/Core/Mvvm.Core/Mvvm.Core.csproj
deleted file mode 100644
index 7326a62..0000000
--- a/CSharp/Core/Mvvm.Core/Mvvm.Core.csproj
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
- enable
-
-
-
diff --git a/CSharp/Core/Mvvm.Core/ObservableObject.cs b/CSharp/Core/Mvvm.Core/ObservableObject.cs
deleted file mode 100644
index 64cedac..0000000
--- a/CSharp/Core/Mvvm.Core/ObservableObject.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-
-namespace Mvvm.Core;
-
-public class ObservableObject : INotifyPropertyChanged
-{
- protected bool Set(ref TValue field, TValue newValue, [CallerMemberName] string? propertyName = null)
- {
- if (EqualityComparer.Default.Equals(field, newValue)) return false;
- field = newValue;
- OnPropertyChanged(propertyName);
-
- return true;
- }
-
- public event PropertyChangedEventHandler? PropertyChanged;
-
- protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
- => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
-}
\ No newline at end of file
diff --git a/CSharp/Core/Mvvm.Core/ViewModel.cs b/CSharp/Core/Mvvm.Core/ViewModel.cs
deleted file mode 100644
index 3785fbc..0000000
--- a/CSharp/Core/Mvvm.Core/ViewModel.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace Mvvm.Core;
-
-public class ViewModel : ObservableObject { /* skip */ }
\ No newline at end of file
diff --git a/CSharp/Core/Serilog.Sinks.LogView.Core/DataStoreLoggerSink.cs b/CSharp/Serilog.Sinks.LogView.Core/DataStoreLoggerSink.cs
similarity index 98%
rename from CSharp/Core/Serilog.Sinks.LogView.Core/DataStoreLoggerSink.cs
rename to CSharp/Serilog.Sinks.LogView.Core/DataStoreLoggerSink.cs
index 32415da..bc937e5 100644
--- a/CSharp/Core/Serilog.Sinks.LogView.Core/DataStoreLoggerSink.cs
+++ b/CSharp/Serilog.Sinks.LogView.Core/DataStoreLoggerSink.cs
@@ -3,6 +3,7 @@ using LogViewer.Core;
using Microsoft.Extensions.Logging;
using Serilog.Core;
using System.Globalization;
+using Serilog.Sinks.LogView.Core.Logging;
namespace Serilog.Sinks.LogView.Core;
diff --git a/CSharp/Core/Serilog.Sinks.LogView.Core/Extensions/DataStoreLoggerSinkExtensions.cs b/CSharp/Serilog.Sinks.LogView.Core/Extensions/DataStoreLoggerSinkExtensions.cs
similarity index 90%
rename from CSharp/Core/Serilog.Sinks.LogView.Core/Extensions/DataStoreLoggerSinkExtensions.cs
rename to CSharp/Serilog.Sinks.LogView.Core/Extensions/DataStoreLoggerSinkExtensions.cs
index 8113e2c..56ff86f 100644
--- a/CSharp/Core/Serilog.Sinks.LogView.Core/Extensions/DataStoreLoggerSinkExtensions.cs
+++ b/CSharp/Serilog.Sinks.LogView.Core/Extensions/DataStoreLoggerSinkExtensions.cs
@@ -1,7 +1,8 @@
using Serilog.Configuration;
using LogViewer.Core;
+using Serilog.Sinks.LogView.Core.Logging;
-namespace Serilog.Sinks.LogView.Core;
+namespace Serilog.Sinks.LogView.Core.Extensions;
public static class DataStoreLoggerSinkExtensions
{
diff --git a/CSharp/Core/LogViewer.Core/Extensions/LoggerExtensions.cs b/CSharp/Serilog.Sinks.LogView.Core/Extensions/LoggerExtensions.cs
similarity index 100%
rename from CSharp/Core/LogViewer.Core/Extensions/LoggerExtensions.cs
rename to CSharp/Serilog.Sinks.LogView.Core/Extensions/LoggerExtensions.cs
diff --git a/CSharp/Core/LogViewer.Core/Logging/DataStoreLoggerConfiguration.cs b/CSharp/Serilog.Sinks.LogView.Core/Logging/DataStoreLoggerConfiguration.cs
similarity index 94%
rename from CSharp/Core/LogViewer.Core/Logging/DataStoreLoggerConfiguration.cs
rename to CSharp/Serilog.Sinks.LogView.Core/Logging/DataStoreLoggerConfiguration.cs
index a5fb128..27f44fb 100644
--- a/CSharp/Core/LogViewer.Core/Logging/DataStoreLoggerConfiguration.cs
+++ b/CSharp/Serilog.Sinks.LogView.Core/Logging/DataStoreLoggerConfiguration.cs
@@ -1,5 +1,6 @@
using System.Drawing;
using Microsoft.Extensions.Logging;
+using Serilog.Sinks.LogView.Core.Logging;
namespace LogViewer.Core;
diff --git a/CSharp/Core/LogViewer.Core/Logging/ILogDataStore.cs b/CSharp/Serilog.Sinks.LogView.Core/Logging/ILogDataStore.cs
similarity index 78%
rename from CSharp/Core/LogViewer.Core/Logging/ILogDataStore.cs
rename to CSharp/Serilog.Sinks.LogView.Core/Logging/ILogDataStore.cs
index 67d1c75..f4dc33b 100644
--- a/CSharp/Core/LogViewer.Core/Logging/ILogDataStore.cs
+++ b/CSharp/Serilog.Sinks.LogView.Core/Logging/ILogDataStore.cs
@@ -1,6 +1,6 @@
using System.Collections.ObjectModel;
-namespace LogViewer.Core;
+namespace Serilog.Sinks.LogView.Core.Logging;
public interface ILogDataStore
{
diff --git a/CSharp/Core/LogViewer.Core/Logging/ILogDataStoreCore.cs b/CSharp/Serilog.Sinks.LogView.Core/Logging/ILogDataStoreCore.cs
similarity index 62%
rename from CSharp/Core/LogViewer.Core/Logging/ILogDataStoreCore.cs
rename to CSharp/Serilog.Sinks.LogView.Core/Logging/ILogDataStoreCore.cs
index 2337da8..3e407df 100644
--- a/CSharp/Core/LogViewer.Core/Logging/ILogDataStoreCore.cs
+++ b/CSharp/Serilog.Sinks.LogView.Core/Logging/ILogDataStoreCore.cs
@@ -1,4 +1,4 @@
-namespace LogViewer.Core;
+namespace Serilog.Sinks.LogView.Core.Logging;
public interface ILogDataStoreCore
{
diff --git a/CSharp/Core/LogViewer.Core/Logging/LogDataStore.cs b/CSharp/Serilog.Sinks.LogView.Core/Logging/LogDataStore.cs
similarity index 92%
rename from CSharp/Core/LogViewer.Core/Logging/LogDataStore.cs
rename to CSharp/Serilog.Sinks.LogView.Core/Logging/LogDataStore.cs
index 982dd28..29532a9 100644
--- a/CSharp/Core/LogViewer.Core/Logging/LogDataStore.cs
+++ b/CSharp/Serilog.Sinks.LogView.Core/Logging/LogDataStore.cs
@@ -1,6 +1,6 @@
using System.Collections.ObjectModel;
-namespace LogViewer.Core;
+namespace Serilog.Sinks.LogView.Core.Logging;
public class LogDataStore : ILogDataStore
{
diff --git a/CSharp/Core/LogViewer.Core/Logging/LogEntryColor.cs b/CSharp/Serilog.Sinks.LogView.Core/Logging/LogEntryColor.cs
similarity index 79%
rename from CSharp/Core/LogViewer.Core/Logging/LogEntryColor.cs
rename to CSharp/Serilog.Sinks.LogView.Core/Logging/LogEntryColor.cs
index c1f7fcf..b05e043 100644
--- a/CSharp/Core/LogViewer.Core/Logging/LogEntryColor.cs
+++ b/CSharp/Serilog.Sinks.LogView.Core/Logging/LogEntryColor.cs
@@ -1,6 +1,6 @@
using System.Drawing;
-namespace LogViewer.Core;
+namespace Serilog.Sinks.LogView.Core.Logging;
public class LogEntryColor
{
diff --git a/CSharp/Core/LogViewer.Core/Logging/LogModel.cs b/CSharp/Serilog.Sinks.LogView.Core/Logging/LogModel.cs
similarity index 88%
rename from CSharp/Core/LogViewer.Core/Logging/LogModel.cs
rename to CSharp/Serilog.Sinks.LogView.Core/Logging/LogModel.cs
index d8e27fd..dd729cb 100644
--- a/CSharp/Core/LogViewer.Core/Logging/LogModel.cs
+++ b/CSharp/Serilog.Sinks.LogView.Core/Logging/LogModel.cs
@@ -1,6 +1,6 @@
using Microsoft.Extensions.Logging;
-namespace LogViewer.Core;
+namespace Serilog.Sinks.LogView.Core.Logging;
public class LogModel
{
diff --git a/CSharp/Core/Serilog.Sinks.LogView.Core/Serilog.Sinks.LogView.Core.csproj b/CSharp/Serilog.Sinks.LogView.Core/Serilog.Sinks.LogView.Core.csproj
similarity index 56%
rename from CSharp/Core/Serilog.Sinks.LogView.Core/Serilog.Sinks.LogView.Core.csproj
rename to CSharp/Serilog.Sinks.LogView.Core/Serilog.Sinks.LogView.Core.csproj
index bf3a7a1..7d1c792 100644
--- a/CSharp/Core/Serilog.Sinks.LogView.Core/Serilog.Sinks.LogView.Core.csproj
+++ b/CSharp/Serilog.Sinks.LogView.Core/Serilog.Sinks.LogView.Core.csproj
@@ -1,4 +1,4 @@
-
+
enable
@@ -6,10 +6,7 @@
-
-
-
-
+
diff --git a/Directory.Build.props b/Directory.Build.props
deleted file mode 100644
index aca0a99..0000000
--- a/Directory.Build.props
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- net10.0
- true
- latest
- latest-recommended
- $(MSBuildThisFileDirectory)bin
- $(MSBuildThisFileDirectory)packages
- $(MSBuildProjectName)
- $(AssemblyName)
- $(BinDir)\$(Configuration)\$(MSBuildProjectName)\
- $(BinDir)\obj\$(MSBuildProjectName)\
- false
- en
- enable
-
-
-
-
-
-
-
diff --git a/LogViewerControl.sln b/LogViewerControl.sln
index 286bcc3..7d6fa76 100644
--- a/LogViewerControl.sln
+++ b/LogViewerControl.sln
@@ -3,16 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
VisualStudioVersion = 18.4.11626.88
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{A3BEB004-4DF7-4281-9A08-8A7BCD4E3CC9}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogViewer.Core", "CSharp\Core\LogViewer.Core\LogViewer.Core.csproj", "{34F75D8B-6F15-4DE4-8335-FED83557EB8E}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Apps", "Apps", "{42E99803-0A95-4172-9079-3B8BF8CBDE9F}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Controls", "Controls", "{E589E611-C328-4D4F-817D-A91D5A1019FB}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Background Services", "Background Services", "{0CDEA51D-46FE-4767-BA2E-8F14582A926D}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{006FDAED-6319-4976-B8BA-8D94E4574139}"
ProjectSection(SolutionItems) = preProject
LICENSE = LICENSE
@@ -21,25 +13,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RandomLogging.Service", "CSharp\Background Services\RandomLogging.Service\RandomLogging.Service.csproj", "{18BA2294-FE64-481F-A86F-F5FD84438B66}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MsLogger.Core", "CSharp\Core\MsLogger.Core\MsLogger.Core.csproj", "{0EDAAABD-495D-43A4-BDFB-A0506CAAC07E}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LoggerProviders", "LoggerProviders", "{23CB559B-2361-4ED6-8A26-D1B1C2005D65}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MsLogger", "MsLogger", "{8635B709-1D5A-4445-AC45-F99EE264634F}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Serilog", "Serilog", "{578FF757-F837-4C23-B2CA-3CF8B016F6A9}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.LogView.Core", "CSharp\Core\Serilog.Sinks.LogView.Core\Serilog.Sinks.LogView.Core.csproj", "{69763AFC-6182-402D-9418-6A48404C89A0}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaLoggingDI", "CSharp\Applications\AvaloniaLoggingDI\AvaloniaLoggingDI.csproj", "{EA97953E-1223-40D5-A568-8932FDC3105E}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogViewer.Avalonia", "CSharp\Controls\LogViewer.Avalonia\LogViewer.Avalonia.csproj", "{C34C889C-4EB3-45F6-83DE-70252D1D67D5}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaSerilogDI", "CSharp\Applications\AvaloniaSerilogDI\AvaloniaSerilogDI.csproj", "{BCB0601D-E042-4949-8172-7A35A619519C}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaSerilogNoDI", "CSharp\Applications\AvaloniaSerilogNoDI\AvaloniaSerilogNoDI.csproj", "{4E892500-CF59-43A9-9A27-80D8EE028821}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaLoggingNoDI", "CSharp\Applications\AvaloniaLoggingNoDI\AvaloniaLoggingNoDI.csproj", "{85C96F55-572A-4FDF-A028-12D27A48FB4D}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.LogView.Core", "CSharp\Serilog.Sinks.LogView.Core\Serilog.Sinks.LogView.Core.csproj", "{8CCB028B-541F-69E5-085B-EE77E55737E4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -47,59 +25,28 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {34F75D8B-6F15-4DE4-8335-FED83557EB8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {34F75D8B-6F15-4DE4-8335-FED83557EB8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {34F75D8B-6F15-4DE4-8335-FED83557EB8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {34F75D8B-6F15-4DE4-8335-FED83557EB8E}.Release|Any CPU.Build.0 = Release|Any CPU
{18BA2294-FE64-481F-A86F-F5FD84438B66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{18BA2294-FE64-481F-A86F-F5FD84438B66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{18BA2294-FE64-481F-A86F-F5FD84438B66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{18BA2294-FE64-481F-A86F-F5FD84438B66}.Release|Any CPU.Build.0 = Release|Any CPU
- {0EDAAABD-495D-43A4-BDFB-A0506CAAC07E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0EDAAABD-495D-43A4-BDFB-A0506CAAC07E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0EDAAABD-495D-43A4-BDFB-A0506CAAC07E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0EDAAABD-495D-43A4-BDFB-A0506CAAC07E}.Release|Any CPU.Build.0 = Release|Any CPU
- {69763AFC-6182-402D-9418-6A48404C89A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {69763AFC-6182-402D-9418-6A48404C89A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {69763AFC-6182-402D-9418-6A48404C89A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {69763AFC-6182-402D-9418-6A48404C89A0}.Release|Any CPU.Build.0 = Release|Any CPU
- {EA97953E-1223-40D5-A568-8932FDC3105E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EA97953E-1223-40D5-A568-8932FDC3105E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EA97953E-1223-40D5-A568-8932FDC3105E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EA97953E-1223-40D5-A568-8932FDC3105E}.Release|Any CPU.Build.0 = Release|Any CPU
{C34C889C-4EB3-45F6-83DE-70252D1D67D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C34C889C-4EB3-45F6-83DE-70252D1D67D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C34C889C-4EB3-45F6-83DE-70252D1D67D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C34C889C-4EB3-45F6-83DE-70252D1D67D5}.Release|Any CPU.Build.0 = Release|Any CPU
- {BCB0601D-E042-4949-8172-7A35A619519C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BCB0601D-E042-4949-8172-7A35A619519C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BCB0601D-E042-4949-8172-7A35A619519C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BCB0601D-E042-4949-8172-7A35A619519C}.Release|Any CPU.Build.0 = Release|Any CPU
{4E892500-CF59-43A9-9A27-80D8EE028821}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4E892500-CF59-43A9-9A27-80D8EE028821}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4E892500-CF59-43A9-9A27-80D8EE028821}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4E892500-CF59-43A9-9A27-80D8EE028821}.Release|Any CPU.Build.0 = Release|Any CPU
- {85C96F55-572A-4FDF-A028-12D27A48FB4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {85C96F55-572A-4FDF-A028-12D27A48FB4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {85C96F55-572A-4FDF-A028-12D27A48FB4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {85C96F55-572A-4FDF-A028-12D27A48FB4D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8CCB028B-541F-69E5-085B-EE77E55737E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8CCB028B-541F-69E5-085B-EE77E55737E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8CCB028B-541F-69E5-085B-EE77E55737E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8CCB028B-541F-69E5-085B-EE77E55737E4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {34F75D8B-6F15-4DE4-8335-FED83557EB8E} = {A3BEB004-4DF7-4281-9A08-8A7BCD4E3CC9}
- {18BA2294-FE64-481F-A86F-F5FD84438B66} = {0CDEA51D-46FE-4767-BA2E-8F14582A926D}
- {0EDAAABD-495D-43A4-BDFB-A0506CAAC07E} = {23CB559B-2361-4ED6-8A26-D1B1C2005D65}
- {23CB559B-2361-4ED6-8A26-D1B1C2005D65} = {A3BEB004-4DF7-4281-9A08-8A7BCD4E3CC9}
- {8635B709-1D5A-4445-AC45-F99EE264634F} = {42E99803-0A95-4172-9079-3B8BF8CBDE9F}
- {578FF757-F837-4C23-B2CA-3CF8B016F6A9} = {42E99803-0A95-4172-9079-3B8BF8CBDE9F}
- {69763AFC-6182-402D-9418-6A48404C89A0} = {23CB559B-2361-4ED6-8A26-D1B1C2005D65}
- {EA97953E-1223-40D5-A568-8932FDC3105E} = {8635B709-1D5A-4445-AC45-F99EE264634F}
{C34C889C-4EB3-45F6-83DE-70252D1D67D5} = {E589E611-C328-4D4F-817D-A91D5A1019FB}
- {BCB0601D-E042-4949-8172-7A35A619519C} = {578FF757-F837-4C23-B2CA-3CF8B016F6A9}
- {4E892500-CF59-43A9-9A27-80D8EE028821} = {578FF757-F837-4C23-B2CA-3CF8B016F6A9}
- {85C96F55-572A-4FDF-A028-12D27A48FB4D} = {8635B709-1D5A-4445-AC45-F99EE264634F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D6A9B467-ED50-40DB-9FFB-5BE745F08DDB}
diff --git a/Resources/Avalonia.Resources/Assets/avalonia-logo.ico b/Resources/Avalonia.Resources/Assets/avalonia-logo.ico
deleted file mode 100644
index da8d49f..0000000
Binary files a/Resources/Avalonia.Resources/Assets/avalonia-logo.ico and /dev/null differ
diff --git a/Resources/Avalonia.Resources/Avalonia.Resources.vbproj b/Resources/Avalonia.Resources/Avalonia.Resources.vbproj
deleted file mode 100644
index 1178ae0..0000000
--- a/Resources/Avalonia.Resources/Avalonia.Resources.vbproj
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
- Avalonia.Resources
- net7.0
- true
- app.manifest
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Resources/Avalonia.Resources/app.manifest b/Resources/Avalonia.Resources/app.manifest
deleted file mode 100644
index e0ce8d0..0000000
--- a/Resources/Avalonia.Resources/app.manifest
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-