From 5e9f60c5d7b9a50b5e34239611935e6325051257 Mon Sep 17 00:00:00 2001 From: 1 <1@qq> Date: Fri, 5 Apr 2019 09:22:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=96=E5=A0=86=E6=A0=88?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/errorinfo/ErrorInfoLogAppender.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java index f0852abfb..bcdea3e5a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java @@ -82,12 +82,10 @@ public class ErrorInfoLogAppender extends AppenderSkeleton { private String readStackTrace(LoggingEvent event) { String[] s = event.getThrowableStrRep(); StringBuilder sb = new StringBuilder(); - if(s != null){ - int len = s.length; + if (s != null) { + int len = Math.min(s.length, ERROR_STACK_TRACE); for (int i = 0; i < len; i++) { - if(i < ERROR_STACK_TRACE){ - sb.append(s[i]).append("\n"); - } + sb.append(s[i]).append("\n"); } } return sb.toString();