From a3facd8bc2cd24f6c5f5f9f0412a8c85a262010d Mon Sep 17 00:00:00 2001 From: EonaCat Date: Sun, 25 Dec 2022 11:05:41 +0100 Subject: [PATCH] Updated --- EonaCat.Logger/EonaCat.Logger.csproj | 2 +- EonaCat.Logger/Managers/LogHelper.cs | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/EonaCat.Logger/EonaCat.Logger.csproj b/EonaCat.Logger/EonaCat.Logger.csproj index 48b645b..9ddf542 100644 --- a/EonaCat.Logger/EonaCat.Logger.csproj +++ b/EonaCat.Logger/EonaCat.Logger.csproj @@ -8,7 +8,7 @@ net6.0; icon.ico - 1.0.3 + 1.0.4 EonaCat (Jeroen Saey) true EonaCat (Jeroen Saey) diff --git a/EonaCat.Logger/Managers/LogHelper.cs b/EonaCat.Logger/Managers/LogHelper.cs index d072125..6f74fee 100644 --- a/EonaCat.Logger/Managers/LogHelper.cs +++ b/EonaCat.Logger/Managers/LogHelper.cs @@ -59,10 +59,19 @@ namespace EonaCat.logger.Managers header = header.Replace("{sev}", logType.ToString()); } - string fullMessage = "[EonaCatLogger]" + " " + header + " " + currentMessage; + string fullMessage = AddHeaderIfNotExists(header, currentMessage); return fullMessage; } + private static string AddHeaderIfNotExists(string header, string currentMessage) + { + if (!currentMessage.Contains("[EonaCatLogger]")) + { + return "[EonaCatLogger]" + " " + header + " " + currentMessage; + } + return currentMessage; + } + /// /// Formats a given exception as a string ///