Skip to content

Commit

Permalink
Trim brackets end of log if nobody called "printStackTrace()"
Browse files Browse the repository at this point in the history
  • Loading branch information
zhi1ong committed Jun 22, 2021
1 parent e644bcf commit 64238e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public void onClick(View v) {
switch (v.getId()) {
case R.id.openLog:
ARouter.openLog();
// ARouter.printStackTrace();
break;
case R.id.openDebug:
ARouter.openDebug();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ public String getDefaultTag() {
}

public static String getExtInfo(StackTraceElement stackTraceElement) {

String separator = " & ";
StringBuilder sb = new StringBuilder("[");

if (isShowStackTrace) {
String separator = " & ";
StringBuilder sb = new StringBuilder("[");

String threadName = Thread.currentThread().getName();
String fileName = stackTraceElement.getFileName();
String className = stackTraceElement.getClassName();
Expand All @@ -116,9 +115,11 @@ public static String getExtInfo(StackTraceElement stackTraceElement) {
sb.append("ClassName=").append(className).append(separator);
sb.append("MethodName=").append(methodName).append(separator);
sb.append("LineNumber=").append(lineNumber);

sb.append(" ] ");
return sb.toString();
}

sb.append(" ] ");
return sb.toString();
return "";
}
}

0 comments on commit 64238e9

Please sign in to comment.