update time inmtervall for log

This commit is contained in:
atef 2024-06-21 15:36:49 +02:00
parent 4e6dcb9895
commit 27792126a9
1 changed files with 2 additions and 1 deletions

View File

@ -40,7 +40,8 @@ public class CustomLogger : ILogger
File.Delete(logFiles.First());
}
var timestamp = "Timestamp;" + DateTime.Now.ToUnixTime() + Environment.NewLine;
var roundedUnixTimestamp = DateTime.Now.ToUnixTime() % 2 == 0 ? DateTime.Now.ToUnixTime() : DateTime.Now.ToUnixTime() + 1;
var timestamp = "Timestamp;" + roundedUnixTimestamp + Environment.NewLine;
var logFileBackupPath = Path.Combine(logFileDir, $"{logFileBaseName}_{DateTime.Now.ToUnixTime()}{logFileExt}");
File.AppendAllText(logFileBackupPath, timestamp + logMessage + Environment.NewLine);