Screenshot

This commit is contained in:
seerge
2023-03-14 17:53:15 +01:00
parent 9bb5e41a5d
commit d248fcf384
2 changed files with 7 additions and 7 deletions

View File

@@ -21,10 +21,7 @@ public static class Logger
w.WriteLine($"{DateTime.Now}: {logMessage}");
w.Close();
}
} catch
{
}
} catch { }
if (new Random().Next(100) == 1) Cleanup();
@@ -33,9 +30,12 @@ public static class Logger
public static void Cleanup()
{
var file = File.ReadAllLines(logFile);
int skip = Math.Max(0, file.Count() - 500);
File.WriteAllLines(logFile,file.Skip(skip).ToArray());
try
{
var file = File.ReadAllLines(logFile);
int skip = Math.Max(0, file.Count() - 500);
File.WriteAllLines(logFile, file.Skip(skip).ToArray());
} catch { }
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 3.4 MiB