hotspot/src/share/vm/utilities/exceptions.cpp
changeset 37110 0c468eab5c66
parent 35477 7a00b08d27bc
child 37190 09d719d466a6
--- a/hotspot/src/share/vm/utilities/exceptions.cpp	Tue Mar 15 15:29:42 2016 +0100
+++ b/hotspot/src/share/vm/utilities/exceptions.cpp	Tue Mar 15 15:43:04 2016 -0400
@@ -52,11 +52,11 @@
 }
 
 void ThreadShadow::clear_pending_exception() {
-  if (TraceClearedExceptions) {
-    if (_pending_exception != NULL) {
-      tty->print_cr("Thread::clear_pending_exception: cleared exception:");
-      _pending_exception->print();
-    }
+  if (_pending_exception != NULL && log_is_enabled(Debug, exceptions)) {
+    ResourceMark rm;
+    outputStream* logst = LogHandle(exceptions)::debug_stream();
+    logst->print("Thread::clear_pending_exception: cleared exception:");
+    _pending_exception->print_on(logst);
   }
   _pending_exception = NULL;
   _exception_file    = NULL;