pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1840848 - /pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java
Date Thu, 13 Sep 2018 18:44:32 GMT
Author: tilman
Date: Thu Sep 13 18:44:32 2018
New Revision: 1840848

URL: http://svn.apache.org/viewvc?rev=1840848&view=rev
Log:
PDFBOX-2941: restore logging window by moving all logging after initialization of logfactory

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

Modified: pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java?rev=1840848&r1=1840847&r2=1840848&view=diff
==============================================================================
--- pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java (original)
+++ pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java Thu Sep
13 18:44:32 2018
@@ -182,17 +182,15 @@ public class PDFDebugger extends JFrame
 
     /**
      * Constructor.
+     *
+     * @param isPageMode true if pages are to be displayed, false if internal structure is
to be
+     * displayed.
      */
-    public PDFDebugger(boolean viewPages)
+    public PDFDebugger(boolean isPageMode)
     {
-        isPageMode = viewPages;
+        this.isPageMode = isPageMode;
         loadConfiguration();
         initComponents();
-
-        // use our custom logger
-        // this works only if there is no "LogFactory.getLog()" in this class!
-        LogDialog.init(this, statusBar.getLogLabel());
-        System.setProperty("org.apache.commons.logging.Log", "org.apache.pdfbox.debugger.ui.DebugLog");
     }
 
     /**
@@ -231,17 +229,6 @@ public class PDFDebugger extends JFrame
             }
         });
 
-        // trigger premature initializations for more accurate rendering benchmarks
-        // See discussion in PDFBOX-3988
-        if (PDType1Font.COURIER.isStandard14())
-        {
-            // Yes this is always true
-            PDDeviceCMYK.INSTANCE.toRGB(new float[] { 0, 0, 0, 0} );
-            PDDeviceRGB.INSTANCE.toRGB(new float[] { 0, 0, 0 } );
-            IIORegistry.getDefaultInstance();
-            FilterFactory.INSTANCE.getFilter(COSName.FLATE_DECODE);
-        }
-
         // open file, if any
         String filename = null;
         String password = "";
@@ -268,8 +255,25 @@ public class PDFDebugger extends JFrame
             }
         }
         final PDFDebugger viewer = new PDFDebugger(viewPages);
-        
-        
+
+        // use our custom logger
+        // this works only if there is no "LogFactory.getLog()" in this class,
+        // and if there are no methods that call logging, even invisible
+        // use reduced file from PDFBOX-3653 to see logging
+        LogDialog.init(viewer, viewer.statusBar.getLogLabel());
+        System.setProperty("org.apache.commons.logging.Log", "org.apache.pdfbox.debugger.ui.DebugLog");
+
+        // trigger premature initializations for more accurate rendering benchmarks
+        // See discussion in PDFBOX-3988
+        if (PDType1Font.COURIER.isStandard14())
+        {
+            // Yes this is always true
+            PDDeviceCMYK.INSTANCE.toRGB(new float[] { 0, 0, 0, 0} );
+            PDDeviceRGB.INSTANCE.toRGB(new float[] { 0, 0, 0 } );
+            IIORegistry.getDefaultInstance();
+            FilterFactory.INSTANCE.getFilter(COSName.FLATE_DECODE);
+        }
+
         if (filename != null)
         {
             File file = new File(filename);



Mime
View raw message