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/master 8c77e9553 -> 4535e8f09


AMQ-6884 - Replacing printStackTrace() with logging statement


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

Branch: refs/heads/master
Commit: 4535e8f097c993364026c00ed40777c71a36a6ea
Parents: 8c77e95
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:03 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/4535e8f0/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);
         }