pdfbox-commits mailing list archives

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

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

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

Modified: pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java?rev=1865805&r1=1865804&r2=1865805&view=diff
==============================================================================
--- pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
(original)
+++ pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/streampane/StreamPane.java
Sat Aug 24 04:33:42 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.contentstream.operator.OperatorName;
 import org.apache.pdfbox.cos.COSArray;
@@ -68,6 +70,8 @@ import org.apache.pdfbox.util.Charsets;
  */
 public class StreamPane implements ActionListener
 {
+    private static final Log LOG = LogFactory.getLog(StreamPane.class);
+
     private static final StyleContext CONTEXT = StyleContext.getDefaultStyleContext();
     private static final Style OPERATOR_STYLE = CONTEXT.addStyle("operator", null);
     private static final Style NUMBER_STYLE = CONTEXT.addStyle("number", null);
@@ -189,7 +193,7 @@ public class StreamPane implements Actio
             }
             catch (IOException e)
             {
-                e.printStackTrace();
+                LOG.error(e.getMessage(), e);
             }
         }
     }
@@ -248,7 +252,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);
@@ -274,7 +279,7 @@ public class StreamPane implements Actio
             }
             catch (InterruptedException | ExecutionException e)
             {
-                e.printStackTrace();
+                LOG.error(e.getMessage(), e);
             }
         }
 
@@ -288,7 +293,7 @@ public class StreamPane implements Actio
             }
             catch (IOException e)
             {
-                e.printStackTrace();
+                LOG.error(e.getMessage(), e);
                 return null;
             }
         }
@@ -305,7 +310,7 @@ public class StreamPane implements Actio
                 }
                 catch (BadLocationException e)
                 {
-                    e.printStackTrace();
+                    LOG.error(e.getMessage(), e);
                 }
             }
             return docu;
@@ -348,7 +353,7 @@ public class StreamPane implements Actio
             }
             catch (BadLocationException e)
             {
-                e.printStackTrace();
+                LOG.error(e.getMessage(), e);
             }
         }
 



Mime
View raw message