Updated
This commit is contained in:
@@ -25,8 +25,9 @@ namespace EonaCat.logger.Managers
|
||||
/// <param name="settings">Logger settings</param>
|
||||
/// <param name="logType">logtype for the formatted message</param>
|
||||
/// <param name="currentMessage">The actual message to format with the header</param>
|
||||
/// <param name="dateTime">The dateTime of the message</param>
|
||||
/// <returns></returns>
|
||||
public static string FormatMessageWithHeader(LoggerSettings settings, ELogType logType, string currentMessage)
|
||||
public static string FormatMessageWithHeader(LoggerSettings settings, ELogType logType, string currentMessage, DateTime dateTime)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(currentMessage))
|
||||
{
|
||||
@@ -41,7 +42,7 @@ namespace EonaCat.logger.Managers
|
||||
string header = settings.HeaderFormat;
|
||||
if (header.Contains("{ts}"))
|
||||
{
|
||||
header = header.Replace("{ts}", DateTime.Now.ToUniversalTime().ToString(settings.TimestampFormat));
|
||||
header = header.Replace("{ts}", dateTime.ToString(settings.TimestampFormat));
|
||||
}
|
||||
|
||||
if (header.Contains("{host}"))
|
||||
@@ -209,7 +210,6 @@ namespace EonaCat.logger.Managers
|
||||
if (settings == null) return;
|
||||
if (!settings.EnableFileLogging) return;
|
||||
if (string.IsNullOrWhiteSpace(message)) return;
|
||||
//logger.LogInformation(message);
|
||||
|
||||
int tries = 0;
|
||||
bool completed = false;
|
||||
|
||||
Reference in New Issue
Block a user