()
| 47 | } |
| 48 | |
| 49 | private static void newFile() { |
| 50 | files++; |
| 51 | file = Core.files.local(PVars.ALogPath + "ALog-" + files + ".txt"); |
| 52 | |
| 53 | if (!file.exists()) { |
| 54 | try { file.file().createNewFile(); } |
| 55 | catch (java.io.IOException e) { e.printStackTrace(); } |
| 56 | |
| 57 | } else if (file.length() > maxSize) { |
| 58 | Log.warn("Admin logs --> file '@ALog-@.txt reached the limit of 1 MB. Find another file ...", PVars.ALogPath, files); |
| 59 | newFile(); |
| 60 | return; |
| 61 | |
| 62 | } else saveSettings(); |
| 63 | Log.info("Admin logs --> file '@ALog-@.txt' loaded and ready", PVars.ALogPath, files); |
| 64 | } |
| 65 | } |
no test coverage detected