Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit e3d5c40

Browse files
Only roll over the log file when it is over 10 MBS when developing
1 parent a1ec1cb commit e3d5c40

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/EntryPoint.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,17 @@ private static void Initialize()
4040
var oldLogPath = logPath.Parent.Combine(logPath.FileNameWithoutExtension + "-old" + logPath.ExtensionWithDot);
4141
try
4242
{
43-
oldLogPath.DeleteIfExists();
44-
if (logPath.FileExists())
43+
var shouldRotate = true;
44+
#if DEVELOPER_BUILD
45+
shouldRotate = new FileInfo(logPath).Length > 10 * 1024 * 1024;
46+
#endif
47+
if (shouldRotate)
4548
{
46-
logPath.Move(oldLogPath);
49+
oldLogPath.DeleteIfExists();
50+
if (logPath.FileExists())
51+
{
52+
logPath.Move(oldLogPath);
53+
}
4754
}
4855
}
4956
catch (Exception ex)

0 commit comments

Comments
 (0)