You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Vincent Hennebert <vh...@gmail.com> on 2013/07/30 22:26:22 UTC

Re: svn commit: r1508599 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop: cli/CommandLineOptions.java fonts/apps/AbstractFontReader.java fonts/apps/PFMReader.java fonts/apps/TTFReader.java util/CommandLineLogger.java

Some background on this: for years I had been able to activate debug
output just by uncommenting the LOGLEVEL line in the fop script
(line 246), that I had customized to use a JDK 1.4 logger.

Suddenly, some time last year that ceased working. I finally decided to
investigate and it turned out to be a side effect of the work on URI
resolution.

Here are the gory details:
> 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");
>      }

Previously, a FopFactory instance was created before that code was run.
So the LogFactory had already set itself up to return a certain logger,
Jdk14Logger by default. So setting the "org.apache.commons.logging.Log"
attribute had no effect.

After the URI resolution changes, it appeared that no class that uses
a log was initialized any more before that code was called. Which means
that the LogFactory was still unset, and that code set it to return
a CommandLineLogger. And my custom configuration for Jdk14Logger was no
longer working.

Since that code had been having no effect for years (at least 4,
probably more), and CommandLineLogger is suboptimal anyway (messing up
the output when rendering into stdout rather than a file), I decided to
remove it.

Vincent



On 30/07/13 22:10, vhennebert wrote:
> 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
<snip/>