From 8e7f8f8c1c69cb9fb0733bc99a866a6c9eba7482 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 13 Apr 2010 15:30:02 +0000 Subject: [PATCH] suppress stacks git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1505 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../src/main/java/org/eclipse/jetty/util/log/StdErrLog.java | 4 ++-- .../test/java/org/eclipse/jetty/util/log/StdErrLogTest.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java index 58bf8df615e..e8af4298c52 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java @@ -132,7 +132,7 @@ public class StdErrLog implements Logger tag(d,ms,":DBUG:"); format(msg); if (_hideStacks) - format(th.toString()); + format(String.valueOf(th)); else format(th); System.err.println(_buffer.toString()); @@ -203,7 +203,7 @@ public class StdErrLog implements Logger tag(d,ms,":WARN:"); format(msg); if (_hideStacks) - format(th.toString()); + format(String.valueOf(th)); else format(th); System.err.println(_buffer.toString()); diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java index bdda51facd8..f54df1e6b88 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/StdErrLogTest.java @@ -24,6 +24,7 @@ public class StdErrLogTest extends TestCase { StdErrLog log = new StdErrLog(); log.setDebugEnabled(true); + log.setHideStacks(true); try { log.info("Testing info(msg,null,null) - {} {}",null,null); @@ -52,9 +53,9 @@ public class StdErrLogTest extends TestCase } catch (NullPointerException npe) { - assertTrue("NullPointerException in StdErrLog.", false); System.err.println(npe); npe.printStackTrace(); + assertTrue("NullPointerException in StdErrLog.", false); } } }