Compare commits
3 Commits
appbase-v1
...
appbase-v1
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f6b615949 | |||
| d02d57d4dd | |||
| e337bb7a04 |
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Apr 27 20:18:59 HKT 2026
|
#Tue Apr 28 17:08:04 HKT 2026
|
||||||
stageCount=21
|
stageCount=22
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.15
|
baseVersion=15.15
|
||||||
publishVersion=15.15.20
|
publishVersion=15.15.21
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.15.21
|
baseBetaVersion=15.15.22
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Mon Apr 27 20:18:59 HKT 2026
|
#Tue Apr 28 17:08:04 HKT 2026
|
||||||
stageCount=21
|
stageCount=22
|
||||||
libraryProject=libappbase
|
libraryProject=libappbase
|
||||||
baseVersion=15.15
|
baseVersion=15.15
|
||||||
publishVersion=15.15.20
|
publishVersion=15.15.21
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.15.21
|
baseBetaVersion=15.15.22
|
||||||
|
|||||||
@@ -100,10 +100,52 @@ public class LogUtils {
|
|||||||
// 加载当前应用下的所有类的 TAG
|
// 加载当前应用下的所有类的 TAG
|
||||||
addClassTAGList();
|
addClassTAGList();
|
||||||
loadTAGBeanSettings();
|
loadTAGBeanSettings();
|
||||||
|
checkAndTrimLogFileSize();
|
||||||
_IsInited = true;
|
_IsInited = true;
|
||||||
LogUtils.d(TAG, String.format("mapTAGList : %s", mapTAGList.toString()));
|
LogUtils.d(TAG, String.format("mapTAGList : %s", mapTAGList.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void checkAndTrimLogFileSize() {
|
||||||
|
if (_mfLogCatchFile == null || !_mfLogCatchFile.exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final long MAX_FILE_SIZE = 6291456L;
|
||||||
|
final long KEEP_FILE_SIZE = 3145728L;
|
||||||
|
|
||||||
|
long fileSize = _mfLogCatchFile.length();
|
||||||
|
if (fileSize <= MAX_FILE_SIZE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
long needSkip = fileSize - KEEP_FILE_SIZE;
|
||||||
|
|
||||||
|
try (FileInputStream fis = new FileInputStream(_mfLogCatchFile);
|
||||||
|
BufferedReader reader = new BufferedReader(new InputStreamReader(fis));
|
||||||
|
FileOutputStream fos = new FileOutputStream(_mfLogCatchFile);
|
||||||
|
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(fos))) {
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String line;
|
||||||
|
long skippedTotal = 0;
|
||||||
|
final String lineBreak = System.lineSeparator();
|
||||||
|
|
||||||
|
while ((line = reader.readLine()) != null) {
|
||||||
|
byte[] lineBytes = line.getBytes();
|
||||||
|
skippedTotal += lineBytes.length + lineBreak.getBytes().length;
|
||||||
|
|
||||||
|
if (skippedTotal > needSkip) {
|
||||||
|
sb.append(line).append(lineBreak);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
writer.write(sb.toString());
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static Map<String, Boolean> getMapTAGList() {
|
public static Map<String, Boolean> getMapTAGList() {
|
||||||
return mapTAGList;
|
return mapTAGList;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user