This commit is contained in:
2022-12-25 11:05:41 +01:00
parent 795f9807d5
commit a3facd8bc2
2 changed files with 11 additions and 2 deletions

View File

@@ -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;
}
/// <summary>
/// Formats a given exception as a string
/// </summary>