mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2024-11-22 06:18:46 +00:00
feat: 线程中断只显示一次调试信息
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
c18bae3b8e
commit
5d6035ba9e
@ -71,17 +71,7 @@ public class MainThreadCheckTask extends TimerTask {
|
||||
}
|
||||
}
|
||||
if (tip != null) {
|
||||
tick();
|
||||
if (stopTime > 1) {
|
||||
Log.console(prefix + tip);
|
||||
if (ConfigManager.i().isMainThreadDebug()) {
|
||||
int l = stackTrace.length > 10 ? 10 : stackTrace.length;
|
||||
for (int i = 0; i < l; i++) {
|
||||
StackTraceElement ste = stackTrace[i];
|
||||
Log.console(errStackTrace, ste.getClassName(), ste.getMethodName(), ste.getFileName() == null ? "未知" : ste.getFileName(), ste.getLineNumber());
|
||||
}
|
||||
}
|
||||
}
|
||||
tick(tip, stackTrace);
|
||||
} else {
|
||||
stopTime = 0;
|
||||
}
|
||||
@ -92,10 +82,19 @@ public class MainThreadCheckTask extends TimerTask {
|
||||
return traceElement.getClassName().equals(className) && traceElement.getMethodName().equals(methodName);
|
||||
}
|
||||
|
||||
private void tick() {
|
||||
private void tick(String tip, StackTraceElement[] stackTrace) {
|
||||
stopTime += 0.5;
|
||||
if (stopTime >= 45 && stopTime % 5 == 0) {
|
||||
if (stopTime > 1 && stopTime < 2) {
|
||||
Log.console(prefix + tip);
|
||||
if (ConfigManager.i().isMainThreadDebug()) {
|
||||
for (StackTraceElement ste : stackTrace) {
|
||||
Log.console(errStackTrace, ste.getClassName(), ste.getMethodName(), ste.getFileName() == null ? "未知" : ste.getFileName(), ste.getLineNumber());
|
||||
}
|
||||
}
|
||||
} else if (stopTime >= 45) {
|
||||
if (stopTime < 46) {
|
||||
Log.console(prefix + deliver, stopTime);
|
||||
}
|
||||
wttick();
|
||||
}
|
||||
}
|
||||
|
@ -10,4 +10,4 @@ ThreadSafe: true
|
||||
#是否开启主线程IO检测
|
||||
MainThreadCheck: true
|
||||
#是否开启调试模式
|
||||
Debug: false
|
||||
Debug: true
|
Loading…
Reference in New Issue
Block a user