From 681a940f9661769945b2cb40b141e66d065d32cf Mon Sep 17 00:00:00 2001 From: EonaCat Date: Thu, 8 Feb 2024 20:33:44 +0100 Subject: [PATCH] Added .NET 4.8 and upgraded project to .NET 8.0 --- EonaCat.Logger/EonaCat.Logger.csproj | 56 +++++++++---------- .../EonaCatCoreLogger/FileLoggerProvider.cs | 2 +- EonaCat.Logger/Managers/LogHelper.cs | 1 + EonaCat.Logger/Managers/LogManager.cs | 6 +- README.md | 2 +- 5 files changed, 32 insertions(+), 35 deletions(-) diff --git a/EonaCat.Logger/EonaCat.Logger.csproj b/EonaCat.Logger/EonaCat.Logger.csproj index 2ba29cf..d37b7ef 100644 --- a/EonaCat.Logger/EonaCat.Logger.csproj +++ b/EonaCat.Logger/EonaCat.Logger.csproj @@ -1,22 +1,18 @@  - - - netstandard2.1; - net6.0; - net7.0; - + .netstandard2.1; net6.0; net7.0; net8.0; net4.8; icon.ico - 1.2.3 + latest + 1.2.4 EonaCat (Jeroen Saey) true EonaCat (Jeroen Saey) icon.png https://www.nuget.org/packages/EonaCat.Logger/ - EonaCat.Logger is a logging library created for .NET Standard. + EonaCat.Logger is a logging library Public release version EonaCat (Jeroen Saey) - EonaCat;Logger;.NET Standard;EonaCatLogger;Log;Writer;Jeroen;Saey + EonaCat;Logger;EonaCatLogger;Log;Writer;Jeroen;Saey README.md True @@ -25,30 +21,28 @@ EonaCat.Logger git - - - - - True - \ - - - True - \ - - - True - - - - + + + + True + \ + + + True + \ + + + True + + + + - - - + + + - True @@ -59,4 +53,4 @@ \ - + \ No newline at end of file diff --git a/EonaCat.Logger/EonaCatCoreLogger/FileLoggerProvider.cs b/EonaCat.Logger/EonaCatCoreLogger/FileLoggerProvider.cs index 5e12ef2..5dc1794 100644 --- a/EonaCat.Logger/EonaCatCoreLogger/FileLoggerProvider.cs +++ b/EonaCat.Logger/EonaCatCoreLogger/FileLoggerProvider.cs @@ -94,7 +94,7 @@ namespace EonaCat.Logger.EonaCatCoreLogger File.Delete(rollOverFile); } fileInfo.CopyTo(rollOverFile); - await File.WriteAllTextAsync(LogFile, string.Empty, cancellationToken).ConfigureAwait(false); + File.WriteAllText(LogFile, string.Empty); } else { diff --git a/EonaCat.Logger/Managers/LogHelper.cs b/EonaCat.Logger/Managers/LogHelper.cs index f5ca71d..1315c4f 100644 --- a/EonaCat.Logger/Managers/LogHelper.cs +++ b/EonaCat.Logger/Managers/LogHelper.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Net; using System.Net.Http; diff --git a/EonaCat.Logger/Managers/LogManager.cs b/EonaCat.Logger/Managers/LogManager.cs index 3b59ed8..45b843e 100644 --- a/EonaCat.Logger/Managers/LogManager.cs +++ b/EonaCat.Logger/Managers/LogManager.cs @@ -10,6 +10,7 @@ using EonaCat.Logger.EonaCatCoreLogger; using EonaCat.Logger.EonaCatCoreLogger.Extensions; using EonaCat.Logger.EonaCatCoreLogger.Models; using EonaCat.Logger.Extensions; +using System.Text; namespace EonaCat.Logger.Managers { @@ -27,7 +28,7 @@ namespace EonaCat.Logger.Managers public string CurrentLogFile => LoggerProvider is FileLoggerProvider fileLoggerProvider ? fileLoggerProvider.LogFile : string.Empty; public bool IsRunning { get; private set; } - + private static LogManager _instance; private readonly CancellationTokenSource _tokenSource = new CancellationTokenSource(); @@ -154,8 +155,9 @@ namespace EonaCat.Logger.Managers Settings.OnLogEvent(logMessage); } + - public void Reset() => Settings.ResetLogEvent(); + public void Reset() => Settings.ResetLogEvent(); public LogManager(LoggerSettings settings, string serverIp, int serverPort) { diff --git a/README.md b/README.md index 9e86eec..33485b1 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ LogManager.Instance.Write("TRAFFIC", ELogType.TRAFFIC, true); LogManager.Instance.Write("NONE", ELogType.NONE, true); ``` -**Logging in ASP .Net 6.0 or higher: ** +**Logging in .NET 4.8 or higher: ** ```csharp public class Program