pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1865804 - /pdfbox/branches/issue45/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
Date Sat, 24 Aug 2019 04:33:38 GMT
Author: tilman
Date: Sat Aug 24 04:33:38 2019
New Revision: 1865804

URL: http://svn.apache.org/viewvc?rev=1865804&view=rev
Log:
PDFBOX-4071: improve logging

Modified:
    pdfbox/branches/issue45/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java

Modified: pdfbox/branches/issue45/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java?rev=1865804&r1=1865803&r2=1865804&view=diff
==============================================================================
--- pdfbox/branches/issue45/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
(original)
+++ pdfbox/branches/issue45/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
Sat Aug 24 04:33:38 2019
@@ -43,6 +43,8 @@ import javax.swing.text.Style;
 import javax.swing.text.StyleConstants;
 import javax.swing.text.StyleContext;
 import javax.swing.text.StyledDocument;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.pdfbox.contentstream.operator.Operator;
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSBase;
@@ -67,6 +69,8 @@ import org.apache.pdfbox.util.Charsets;
  */
 public class StreamPane implements ActionListener
 {
+    private static final Log LOG = LogFactory.getLog(StreamPane.class);
+
     public static final String BEGIN_TEXT_OBJECT = "BT";
     public static final String END_TEXT_OBJECT = "ET";
     public static final String SAVE_GRAPHICS_STATE = "q";
@@ -199,7 +203,7 @@ public class StreamPane implements Actio
             }
             catch (IOException e)
             {
-                e.printStackTrace();
+                LOG.error(e.getMessage(), e);
             }
         }
     }
@@ -258,7 +262,8 @@ public class StreamPane implements Actio
             String encoding = "ISO-8859-1";
             synchronized (stream)
             {
-                if (stream.isXmlMetadata()) {
+                if (stream.isXmlMetadata())
+                {
                     encoding = "UTF-8";
                 }
                 InputStream inputStream = stream.getStream(filterKey);
@@ -284,11 +289,11 @@ public class StreamPane implements Actio
             }
             catch (InterruptedException e)
             {
-                e.printStackTrace();
+                LOG.error(e.getMessage(), e);
             }
             catch (ExecutionException e)
             {
-                e.printStackTrace();
+                LOG.error(e.getMessage(), e);
             }
         }
 
@@ -302,7 +307,7 @@ public class StreamPane implements Actio
             }
             catch (IOException e)
             {
-                e.printStackTrace();
+                LOG.error(e.getMessage(), e);
                 return null;
             }
         }
@@ -319,7 +324,7 @@ public class StreamPane implements Actio
                 }
                 catch (BadLocationException e)
                 {
-                    e.printStackTrace();
+                    LOG.error(e.getMessage(), e);
                 }
             }
             return docu;
@@ -362,7 +367,7 @@ public class StreamPane implements Actio
             }
             catch (BadLocationException e)
             {
-                e.printStackTrace();
+                LOG.error(e.getMessage(), e);
             }
         }
 



Mime
View raw message