A static class in TavernLib, TavernLib.Debugging.
Moves the game's unity-log.csv into a numbered file in an Archives folder next to it, keeping 20. TavernLib runs it on servers it manages (not with /launcherauth).
Fields
3 private and internal fields
| Member | What it is |
|---|
private const int MaxArchiveFiles | Most archived logs kept, 20; the oldest are deleted first. |
private const long SizeThresholdBytes | Log size at which ShouldAutoArchive is true, 10,000,000 bytes. |
private const string TargetName | The NLog target name assumed for the Unity log, "unity-log". |
Methods
| Member | What it is |
|---|
static string ArchiveLogNow() | Moves the log now, briefly clearing NLog's configuration to free the file. Returns the archive's path, or null if nothing was moved. |
static bool ShouldAutoArchive() | True when unity-log.csv is 10 MB or more. |
3 private and internal methods
| Member | What it is |
|---|
private static FileTarget FindUnityLogTarget() | Finds the NLog file target for the Unity log by name, or by a file name ending in unity-log.csv. |
private static string RenderFilePath(FileTarget target) | Returns the file path a target writes to, or null if it can't be worked out. |
private static int? TryParseSequenceNumber(string path, string stem, string ext) | Reads the sequence number from an archived log's file name, or null if it doesn't match. |