diff --git a/hMoney/Apix.cs b/hMoney/Apix.cs index 07d71de..435214b 100644 --- a/hMoney/Apix.cs +++ b/hMoney/Apix.cs @@ -1,4 +1,4 @@ -using Serilog; +using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using static hMoney.Globals; @@ -7,6 +7,8 @@ namespace hMoney { public class Apix { + private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); + public DateTime GetNextTransDate(RepeatType repeatType, DateTime preTransDate, int numOccurrences) { DateTime nextTransDate = preTransDate; @@ -79,7 +81,7 @@ public DateTime GetNextTransDate(RepeatType repeatType, DateTime preTransDate, i } break; default: - Log.Error("Invalid repeat type: " + repeatType); + Logger.Error("Invalid repeat type: " + repeatType); //TODO should raise exception here break; } diff --git a/hMoney/DB.cs b/hMoney/DB.cs index 6baa796..654ab74 100644 --- a/hMoney/DB.cs +++ b/hMoney/DB.cs @@ -1,5 +1,4 @@ -using Serilog; -using System; +using System; using System.Collections.Generic; using System.Data; using System.Data.SQLite; @@ -46,14 +45,10 @@ public class DB const String CONDITION_TODAY = "Today"; const String CONDITION_RECONCILED = "Reconciled"; + private static readonly NLog.Logger Log = NLog.LogManager.GetCurrentClassLogger(); public DB() { Configuration config; - // Setup log (Serilog) - Log.Logger = new LoggerConfiguration() - .MinimumLevel.Debug() - .WriteTo.Console() - .CreateLogger(); // Setup configuration config = new Configuration(); diff --git a/hMoney/FormMain.cs b/hMoney/FormMain.cs index 803ca03..872662b 100644 --- a/hMoney/FormMain.cs +++ b/hMoney/FormMain.cs @@ -1,4 +1,4 @@ -using Serilog; +using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Drawing; @@ -15,22 +15,14 @@ public partial class FormMain : Form private readonly DB db; private readonly Apix api; + private static readonly NLog.Logger Log = NLog.LogManager.GetCurrentClassLogger(); + public FormMain() { // Enable configuration config = new Configuration(); config.Init(); - // Setup log (Serilog) - Log.Logger = new LoggerConfiguration() - .MinimumLevel.Debug() - .WriteTo.Console() - .CreateLogger(); - - Log.Warning("Hello, world!"); - - System.Diagnostics.Debug.WriteLine("diag"); - // Setup i18n System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(config.GetLanguage()); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(config.GetLanguage()); diff --git a/hMoney/hMoney.csproj b/hMoney/hMoney.csproj index 63e7deb..bcb46f0 100644 --- a/hMoney/hMoney.csproj +++ b/hMoney/hMoney.csproj @@ -42,8 +42,9 @@ - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/hMoneyTests/hMoneyTests.csproj b/hMoneyTests/hMoneyTests.csproj index 45b77a6..37e2772 100644 --- a/hMoneyTests/hMoneyTests.csproj +++ b/hMoneyTests/hMoneyTests.csproj @@ -7,9 +7,10 @@ true + + + - - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/hMoneyVSTests/hMoneyVSTests.csproj b/hMoneyVSTests/hMoneyVSTests.csproj index ec72a04..489a6a7 100644 --- a/hMoneyVSTests/hMoneyVSTests.csproj +++ b/hMoneyVSTests/hMoneyVSTests.csproj @@ -8,12 +8,13 @@ + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive