activemq git commit: AMQ-6884 - Replacing printStackTrace() with logging statement

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

activemq git commit: AMQ-6884 - Replacing printStackTrace() with logging statement

cshannon
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.15.x c9eb5a725 -> 7f75b4b9a


AMQ-6884 - Replacing printStackTrace() with logging statement

(cherry picked from commit 4535e8f097c993364026c00ed40777c71a36a6ea)


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/7f75b4b9
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/7f75b4b9
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/7f75b4b9

Branch: refs/heads/activemq-5.15.x
Commit: 7f75b4b9a63c40d37b83c4366834a3fbd946b599
Parents: c9eb5a7
Author: Christopher L. Shannon (cshannon) <[hidden email]>
Authored: Thu Jan 11 07:27:03 2018 -0500
Committer: Christopher L. Shannon (cshannon) <[hidden email]>
Committed: Thu Jan 11 07:27:49 2018 -0500

----------------------------------------------------------------------
 .../org/apache/activemq/transport/nio/SelectorWorker.java   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/7f75b4b9/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
index 1a32346..781ca67 100644
--- a/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
+++ b/activemq-client/src/main/java/org/apache/activemq/transport/nio/SelectorWorker.java
@@ -24,8 +24,13 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class SelectorWorker implements Runnable {
 
+    private static final Logger LOG = LoggerFactory.getLogger(SelectorWorker.class);
+
     private static final AtomicInteger NEXT_ID = new AtomicInteger();
 
     final SelectorManager manager;
@@ -73,7 +78,7 @@ public class SelectorWorker implements Runnable {
             try {
                 task.run();
             } catch (Throwable e) {
-                e.printStackTrace();
+                LOG.debug(e.getMessage(), e);
             }
         }
     }
@@ -142,7 +147,7 @@ public class SelectorWorker implements Runnable {
                 manager.onWorkerEmptyEvent(this);
                 selector.close();
             } catch (IOException ignore) {
-                ignore.printStackTrace();
+                LOG.debug(ignore.getMessage(), ignore);
             }
             Thread.currentThread().setName(origName);
         }