Author: vhennebert
Date: Tue Jul 30 20:10:35 2013
New Revision: 1508599

URL: http://svn.apache.org/r1508599
Log:
Removed obsolete CommandLineLogger.
The Jdk14Logger is guaranteed to be there by default now that the minimal Java 
requirement is 1.5.
Also, CommandLineLogger messes up the output when rendering to stdout.

Removed:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/util/CommandLineLogger.java
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/AbstractFontReader.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/PFMReader.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java?rev=1508599&r1=1508598&r2=1508599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java 
Tue Jul 30 20:10:35 2013
@@ -58,7 +58,6 @@ import org.apache.fop.render.pdf.PDFEncr
 import org.apache.fop.render.print.PagesMode;
 import org.apache.fop.render.print.PrintRenderer;
 import org.apache.fop.render.xml.XMLRenderer;
-import org.apache.fop.util.CommandLineLogger;
 
 /**
  * Options parses the commandline arguments
@@ -146,15 +145,6 @@ public class CommandLineOptions {
      */
     public CommandLineOptions() {
         LogFactory logFactory = LogFactory.getFactory();
-
-        // Enable the simple command line logging when no other logger is
-        // defined.
-        if (System.getProperty("org.apache.commons.logging.Log") == null) {
-            logFactory.setAttribute("org.apache.commons.logging.Log",
-                                            CommandLineLogger.class.getName());
-            setLogLevel("info");
-        }
-
         log = LogFactory.getLog("FOP");
     }
 
@@ -292,7 +282,7 @@ public class CommandLineOptions {
             } else if (args[i].equals("-s")) {
                 suppressLowLevelAreas = Boolean.TRUE;
             } else if (args[i].equals("-d")) {
-                setLogOption("debug", "debug");
+                // nop. Left there for backwards compatibility
             } else if (args[i].equals("-r")) {
                 strictValidation = false;
             } else if (args[i].equals("-conserve")) {
@@ -304,7 +294,7 @@ public class CommandLineOptions {
             } else if (args[i].equals("-dpi")) {
                 i = i + parseResolution(args, i);
             } else if (args[i].equals("-q") || args[i].equals("--quiet")) {
-                setLogOption("quiet", "error");
+                // nop. Left there for backwards compatibility
             } else if (args[i].equals("-fo")) {
                 i = i + parseFOInputOption(args, i);
             } else if (args[i].equals("-xsl")) {
@@ -904,27 +894,6 @@ public class CommandLineOptions {
         }
     }
 
-    private void setLogOption(String option, String level) {
-        if (log instanceof CommandLineLogger
-            || System.getProperty("org.apache.commons.logging.Log") == null) {
-            setLogLevel(level);
-        } else if (log != null) {
-            log.warn("The option " + option + " can only be used");
-            log.warn("with FOP's command line logger,");
-            log.warn("which is the default on the command line.");
-            log.warn("Configure other loggers using Java system properties.");
-        }
-    }
-
-    private void setLogLevel(String level) {
-        // Set the level for future loggers.
-        LogFactory.getFactory().setAttribute("level", level);
-        if (log instanceof CommandLineLogger) {
-            // Set the level for the logger created already.
-            ((CommandLineLogger) log).setLogLevel(level);
-        }
-    }
-
     private void setInputFormat(int format) throws FOPException {
         if (inputmode == NOT_SET || inputmode == format) {
             inputmode = format;
@@ -1208,9 +1177,7 @@ public class CommandLineOptions {
                     + "[-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at 
[mime]|-print] <outfile>\n"
             + " [OPTIONS]  \n"
             + "  -version          print FOP version and exit\n"
-            + "  -d                debug mode   \n"
             + "  -x                dump configuration settings  \n"
-            + "  -q                quiet mode  \n"
             + "  -c cfg.xml        use additional configuration file cfg.xml\n"
             + "  -l lang           the language to use for user information \n"
             + "  -nocs             disable complex script features\n"

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/AbstractFontReader.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/AbstractFontReader.java?rev=1508599&r1=1508598&r2=1508599&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/AbstractFontReader.java
 (original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/AbstractFontReader.java
 Tue Jul 30 20:10:35 2013
@@ -32,8 +32,6 @@ import javax.xml.transform.TransformerFa
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import org.apache.fop.util.CommandLineLogger;
-
 /**
  * Abstract base class for the PFM and TTF Reader command-line applications.
  */
@@ -90,10 +88,6 @@ public abstract class AbstractFontReader
     protected static void setLogLevel(String level) {
         // Set the evel for future loggers.
         LogFactory.getFactory().setAttribute("level", level);
-        if (log instanceof CommandLineLogger) {
-            // Set the level for the logger creates already.
-            ((CommandLineLogger) log).setLogLevel(level);
-        }
     }
 
     /**

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/PFMReader.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/PFMReader.java?rev=1508599&r1=1508598&r2=1508599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/PFMReader.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/PFMReader.java Tue 
Jul 30 20:10:35 2013
@@ -33,7 +33,6 @@ import org.apache.commons.logging.LogFac
 
 import org.apache.fop.Version;
 import org.apache.fop.fonts.type1.PFMFile;
-import org.apache.fop.util.CommandLineLogger;
 
 /**
  * A tool which reads PFM files from Adobe Type 1 fonts and creates
@@ -92,14 +91,7 @@ public class PFMReader extends AbstractF
         Map options = new java.util.HashMap();
         String[] arguments = parseArguments(options, args);
 
-        // Enable the simple command line logging when no other logger is
-        // defined.
         LogFactory logFactory = LogFactory.getFactory();
-        if (System.getProperty("org.apache.commons.logging.Log") == null) {
-            logFactory.setAttribute("org.apache.commons.logging.Log",
-                                            CommandLineLogger.class.getName());
-        }
-
         determineLogLevel(options);
 
         PFMReader app = new PFMReader();

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java?rev=1508599&r1=1508598&r2=1508599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java Tue 
Jul 30 20:10:35 2013
@@ -39,7 +39,6 @@ import org.apache.fop.fonts.CMapSegment;
 import org.apache.fop.fonts.FontUtil;
 import org.apache.fop.fonts.truetype.FontFileReader;
 import org.apache.fop.fonts.truetype.TTFFile;
-import org.apache.fop.util.CommandLineLogger;
 
 // CSOFF: InnerAssignmentCheck
 // CSOFF: LineLengthCheck
@@ -123,14 +122,7 @@ public class TTFReader extends AbstractF
         Map options = new java.util.HashMap();
         String[] arguments = parseArguments(options, args);
 
-        // Enable the simple command line logging when no other logger is
-        // defined.
         LogFactory logFactory = LogFactory.getFactory();
-        if (System.getProperty("org.apache.commons.logging.Log") == null) {
-            logFactory.setAttribute("org.apache.commons.logging.Log",
-                                            CommandLineLogger.class.getName());
-        }
-
         determineLogLevel(options);
 
         TTFReader app = new TTFReader();



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to