You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ke...@apache.org on 2001/08/20 13:19:24 UTC
cvs commit: xml-fop/src/org/apache/fop/tools/anttasks Fop.java
keiron 01/08/20 04:19:24
Modified: src/org/apache/fop/apps CommandLineOptions.java
CommandLineStarter.java Driver.java
PDFOutputHandler.java Starter.java
StreamRenderer.java XTDriver.java
src/org/apache/fop/datatypes LengthPair.java
LengthRange.java MixedLength.java
PercentLength.java TableColLength.java
ToBeImplementedProperty.java
src/org/apache/fop/fo ColorProfile.java Declarations.java
FONode.java FOText.java FOTreeBuilder.java
Property.java Title.java
ToBeImplementedElement.java TreeBuilder.java
Unknown.java
src/org/apache/fop/fo/flow BidiOverride.java Block.java
Character.java ExternalGraphic.java Float.java
Flow.java Footnote.java InitialPropertySet.java
InlineContainer.java Leader.java ListBlock.java
Marker.java MultiCase.java MultiProperties.java
MultiPropertySet.java MultiSwitch.java
MultiToggle.java PageNumber.java
PageNumberCitation.java RetrieveMarker.java
StaticContent.java Table.java TableAndCaption.java
TableCaption.java TableRow.java
src/org/apache/fop/fo/pagination
ConditionalPageMasterReference.java
PageMasterReference.java PageNumberGenerator.java
PageSequence.java PageSequenceMaster.java
RegionBody.java
RepeatablePageMasterAlternatives.java Root.java
SimplePageMaster.java
SinglePageMasterReference.java
src/org/apache/fop/messaging MessageHandler.java
src/org/apache/fop/tools TestConverter.java
src/org/apache/fop/tools/anttasks Fop.java
Log:
changed to logkit for logging only half done
fixed getContentHandler in driver
Revision Changes Path
1.11 +81 -49 xml-fop/src/org/apache/fop/apps/CommandLineOptions.java
Index: CommandLineOptions.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/CommandLineOptions.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- CommandLineOptions.java 2001/07/30 20:29:18 1.10
+++ CommandLineOptions.java 2001/08/20 11:19:22 1.11
@@ -1,5 +1,5 @@
/*
- * $Id: CommandLineOptions.java,v 1.10 2001/07/30 20:29:18 tore Exp $
+ * $Id: CommandLineOptions.java,v 1.11 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -17,6 +17,13 @@
import org.apache.fop.configuration.Configuration;
import org.apache.fop.apps.FOPException;
+import org.apache.log.*;
+import org.apache.log.format.*;
+import org.apache.log.output.io.*;
+import org.apache.log.output.*;
+
+import java.io.*;
+
/**
* Options parses the commandline arguments
*/
@@ -80,8 +87,30 @@
private java.util.Hashtable rendererOptions;
+ private Logger log;
+
public CommandLineOptions(String[] args)
throws FOPException, FileNotFoundException {
+
+ Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
+ PatternFormatter formatter = new PatternFormatter(
+ "[%{priority}]: %{message}\n%{throwable}" );
+
+ LogTarget target = null;
+ boolean doConsoleLogging = true;
+ if (doConsoleLogging) {
+ target = new StreamTarget(System.out, formatter);
+ } else {
+ try {
+ File f = new File("fop.log");
+ target = new FileTarget(f, false, formatter);
+ } catch (IOException e) {}
+ }
+
+ hierarchy.setDefaultLogTarget(target);
+ log = hierarchy.getLoggerFor("fop");
+ log.setPriority(Priority.INFO);
+
boolean optionsParsed = true;
rendererOptions = new java.util.Hashtable();
try {
@@ -232,12 +261,12 @@
if (buffermode == NOT_SET) {
buffermode = BUFFER_FILE;
} else {
- MessageHandler.errorln("ERROR: you can only set one buffer method");
+ log.error("you can only set one buffer method");
printUsage();
}
if ((i + 1 == args.length)
|| (args[i + 1].charAt(0) == '-')) {
- MessageHandler.errorln("ERROR: you must specify the buffer output file");
+ log.error("you must specify the buffer output file");
printUsage();
} else {
bufferFile = new File(args[i + 1]);
@@ -291,7 +320,7 @@
// warning if fofile has been set in xslt mode
if (fofile != null) {
- MessageHandler.errorln("WARNING: Can't use fo file with transform mode! Ignoring.\n"
+ log.warn("Can't use fo file with transform mode! Ignoring.\n"
+ "Your input is " + "\n xmlfile: "
+ xmlfile.getAbsolutePath()
+ "\nxsltfile: "
@@ -312,9 +341,9 @@
} else if (inputmode == FO_INPUT) {
if (xmlfile != null || xsltfile != null) {
- MessageHandler.errorln("WARNING: fo input mode, but xmlfile or xslt file are set:");
- MessageHandler.errorln("xml file: " + xmlfile.toString());
- MessageHandler.errorln("xslt file: " + xsltfile.toString());
+ log.warn("fo input mode, but xmlfile or xslt file are set:");
+ log.error("xml file: " + xmlfile.toString());
+ log.error("xslt file: " + xsltfile.toString());
}
if (!fofile.exists()) {
throw new FileNotFoundException("fo file "
@@ -373,10 +402,11 @@
}
public Starter getStarter() throws FOPException {
+ Starter starter = null;
switch (outputmode) {
case AWT_OUTPUT:
try {
- return ((Starter)Class.forName("org.apache.fop.apps.AWTStarter").getConstructor(new Class[] {
+ starter = ((Starter)Class.forName("org.apache.fop.apps.AWTStarter").getConstructor(new Class[] {
CommandLineOptions.class
}).newInstance(new Object[] {
this
@@ -389,7 +419,7 @@
}
case PRINT_OUTPUT:
try {
- return ((Starter)Class.forName("org.apache.fop.apps.PrintStarter").getConstructor(new Class[] {
+ starter = ((Starter)Class.forName("org.apache.fop.apps.PrintStarter").getConstructor(new Class[] {
CommandLineOptions.class
}).newInstance(new Object[] {
this
@@ -403,8 +433,10 @@
}
default:
- return new CommandLineStarter(this);
+ starter = new CommandLineStarter(this);
}
+ starter.setLogger(log);
+ return starter;
}
public int getInputMode() {
@@ -477,7 +509,7 @@
* shows the commandline syntax including a summary of all available options and some examples
*/
public static void printUsage() {
- MessageHandler.errorln("\nUSAGE\nFop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-pcl|-ps|-txt|-at|-print] <outfile>\n"
+ System.err.println("\nUSAGE\nFop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-pcl|-ps|-txt|-at|-print] <outfile>\n"
+ " [OPTIONS] \n"
+ " -d debug mode \n"
+ " -x dump configuration settings \n"
@@ -513,7 +545,7 @@
* shows the options for print output
*/
public void printUsagePrintOutput() {
- MessageHandler.errorln("USAGE: -print [-Dstart=i] [-Dend=i] [-Dcopies=i] [-Deven=true|false] "
+ System.err.println("USAGE: -print [-Dstart=i] [-Dend=i] [-Dcopies=i] [-Deven=true|false] "
+ " org.apache.fop.apps.Fop (..) -print \n"
+ "Example:\n"
+ "java -Dstart=1 -Dend=2 org.apache.Fop.apps.Fop infile.fo -print ");
@@ -524,88 +556,88 @@
* debug mode. outputs all commandline settings
*/
private void debug() {
- System.out.print("Input mode: ");
+ log.debug("Input mode: ");
switch (inputmode) {
case NOT_SET:
- MessageHandler.logln("not set");
+ log.debug("not set");
break;
case FO_INPUT:
- MessageHandler.logln("FO ");
- MessageHandler.logln("fo input file: " + fofile.toString());
+ log.debug("FO ");
+ log.debug("fo input file: " + fofile.toString());
break;
case XSLT_INPUT:
- MessageHandler.logln("xslt transformation");
- MessageHandler.logln("xml input file: " + xmlfile.toString());
- MessageHandler.logln("xslt stylesheet: " + xsltfile.toString());
+ log.debug("xslt transformation");
+ log.debug("xml input file: " + xmlfile.toString());
+ log.debug("xslt stylesheet: " + xsltfile.toString());
break;
default:
- MessageHandler.logln("unknown input type");
+ log.debug("unknown input type");
}
- System.out.print("Output mode: ");
+ log.debug("Output mode: ");
switch (outputmode) {
case NOT_SET:
- MessageHandler.logln("not set");
+ log.debug("not set");
break;
case PDF_OUTPUT:
- MessageHandler.logln("pdf");
- MessageHandler.logln("output file: " + outfile.toString());
+ log.debug("pdf");
+ log.debug("output file: " + outfile.toString());
break;
case AWT_OUTPUT:
- MessageHandler.logln("awt on screen");
+ log.debug("awt on screen");
if (outfile != null) {
- MessageHandler.logln("ERROR: awt mode, but outfile is set:");
- MessageHandler.logln("out file: " + outfile.toString());
+ log.error("awt mode, but outfile is set:");
+ log.debug("out file: " + outfile.toString());
}
break;
case MIF_OUTPUT:
- MessageHandler.logln("mif");
- MessageHandler.logln("output file: " + outfile.toString());
+ log.debug("mif");
+ log.debug("output file: " + outfile.toString());
break;
case PRINT_OUTPUT:
- MessageHandler.logln("print directly");
+ log.debug("print directly");
if (outfile != null) {
- MessageHandler.logln("ERROR: print mode, but outfile is set:");
- MessageHandler.logln("out file: " + outfile.toString());
+ log.error("print mode, but outfile is set:");
+ log.error("out file: " + outfile.toString());
}
break;
case PCL_OUTPUT:
- MessageHandler.logln("pcl");
- MessageHandler.logln("output file: " + outfile.toString());
+ log.debug("pcl");
+ log.debug("output file: " + outfile.toString());
break;
case PS_OUTPUT:
- MessageHandler.logln("PostScript");
- MessageHandler.logln("output file: " + outfile.toString());
+ log.debug("PostScript");
+ log.debug("output file: " + outfile.toString());
break;
case TXT_OUTPUT:
- MessageHandler.logln("txt");
- MessageHandler.logln("output file: " + outfile.toString());
+ log.debug("txt");
+ log.debug("output file: " + outfile.toString());
break;
default:
- MessageHandler.logln("unknown input type");
+ log.debug("unknown input type");
}
- MessageHandler.logln("OPTIONS");
+ log.debug("OPTIONS");
if (userConfigFile != null) {
- MessageHandler.logln("user configuration file: "
+ log.debug("user configuration file: "
+ userConfigFile.toString());
} else {
- MessageHandler.logln("no user configuration file is used [default]");
+ log.debug("no user configuration file is used [default]");
}
if (errorDump != null) {
- MessageHandler.logln("debug mode on");
+ log.debug("debug mode on");
} else {
- MessageHandler.logln("debug mode off [default]");
+ log.debug("debug mode off [default]");
}
if (dumpConfiguration != null) {
- MessageHandler.logln("dump configuration");
+ log.debug("dump configuration");
} else {
- MessageHandler.logln("don't dump configuration [default]");
+ log.debug("don't dump configuration [default]");
}
if (quiet != null) {
- MessageHandler.logln("quiet mode on");
+ log.debug("quiet mode on");
} else {
- MessageHandler.logln("quiet mode off [default]");
+ log.debug("quiet mode off [default]");
}
}
@@ -614,7 +646,7 @@
public static void main(String args[]) {
/*
* for (int i = 0; i < args.length; i++) {
- * MessageHandler.logln(">"+args[i]+"<");
+ * log.debug(">"+args[i]+"<");
* }
*/
try {
1.10 +13 -6 xml-fop/src/org/apache/fop/apps/CommandLineStarter.java
Index: CommandLineStarter.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/CommandLineStarter.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- CommandLineStarter.java 2001/08/01 23:08:54 1.9
+++ CommandLineStarter.java 2001/08/20 11:19:22 1.10
@@ -1,5 +1,5 @@
/*
- * $Id: CommandLineStarter.java,v 1.9 2001/08/01 23:08:54 gears Exp $
+ * $Id: CommandLineStarter.java,v 1.10 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -13,6 +13,8 @@
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
+import org.apache.log.*;
+
// Java
import java.io.*;
import java.net.URL;
@@ -37,7 +39,8 @@
throws FOPException {
this.commandLineOptions = commandLineOptions;
options.setCommandLineOptions(commandLineOptions);
- errorDump = Configuration.getBooleanValue("debugMode").booleanValue();
+ errorDump =
+ Configuration.getBooleanValue("debugMode").booleanValue();
super.setInputHandler(commandLineOptions.getInputHandler());
}
@@ -47,12 +50,14 @@
*/
public void run() throws FOPException {
String version = Version.getVersion();
- MessageHandler.logln(version);
+
+ log.info(version);
XMLReader parser = inputHandler.getParser();
setParserFeatures(parser);
Driver driver = new Driver();
+ driver.setLogger(log);
driver.setBufferFile(commandLineOptions.getBufferFile());
if (errorDump) {
@@ -61,13 +66,15 @@
try {
driver.setRenderer(commandLineOptions.getRenderer());
- driver.setOutputStream(new FileOutputStream(commandLineOptions.getOutputFile()));
- driver.getRenderer().setOptions(commandLineOptions.getRendererOptions());
+ driver.setOutputStream( new FileOutputStream(
+ commandLineOptions.getOutputFile()));
+ driver.getRenderer().setOptions(
+ commandLineOptions.getRendererOptions());
driver.render(parser, inputHandler.getInputSource());
System.exit(0);
} catch (Exception e) {
if (e instanceof FOPException) {
- throw (FOPException)e;
+ throw (FOPException) e;
}
throw new FOPException(e);
}
1.32 +39 -13 xml-fop/src/org/apache/fop/apps/Driver.java
Index: Driver.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/Driver.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- Driver.java 2001/08/01 23:08:54 1.31
+++ Driver.java 2001/08/20 11:19:22 1.32
@@ -1,5 +1,5 @@
/*
- * $Id: Driver.java,v 1.31 2001/08/01 23:08:54 gears Exp $
+ * $Id: Driver.java,v 1.32 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -12,7 +12,6 @@
import org.apache.fop.fo.ElementMapping;
import org.apache.fop.layout.AreaTree;
import org.apache.fop.render.Renderer;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.configuration.ConfigurationReader;
import org.apache.fop.configuration.Configuration;
import org.apache.fop.tools.DocumentInputSource;
@@ -22,6 +21,12 @@
import org.apache.fop.system.BufferManager;
+import org.apache.log.*;
+import org.apache.log.format.*;
+import org.apache.log.output.io.*;
+import org.apache.log.output.*;
+import org.apache.avalon.framework.logger.Loggable;
+
// DOM
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -84,7 +89,7 @@
* driver.render(parser, fileInputSource(args[0]));
* </PRE>
*/
-public class Driver {
+public class Driver implements Loggable {
/**
* Render to PDF. OutputStream must be set
@@ -166,6 +171,8 @@
*/
private BufferManager _bufferManager;
+ private Logger log;
+
public static final String getParserClassName() {
String parserClassName = null;
try {
@@ -195,6 +202,11 @@
_stream = stream;
}
+ public void setLogger(Logger logger) {
+ log = logger;
+ _treeBuilder.setLogger(log);
+ }
+
/**
* Resets the Driver so it can be reused. Property and element
* mappings are reset to defaults.
@@ -408,6 +420,24 @@
* events but isn't a SAX Parser itself.
*/
public ContentHandler getContentHandler() {
+ if(log == null) {
+ Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
+ PatternFormatter formatter = new PatternFormatter(
+ "[%{priority}]: %{message}\n%{throwable}" );
+
+ LogTarget target = null;
+ target = new StreamTarget(System.out, formatter);
+
+ hierarchy.setDefaultLogTarget(target);
+ log = hierarchy.getLoggerFor("fop");
+ log.setPriority(Priority.INFO);
+ log.error("Logger not set");
+ }
+
+ StreamRenderer streamRenderer = new StreamRenderer(_stream, _renderer);
+ streamRenderer.setLogger(log);
+ _treeBuilder.setStreamRenderer(streamRenderer);
+
return _treeBuilder;
}
@@ -417,9 +447,7 @@
*/
public synchronized void render(XMLReader parser, InputSource source)
throws FOPException {
- StreamRenderer streamRenderer = new StreamRenderer(_stream, _renderer);
- _treeBuilder.setStreamRenderer(streamRenderer);
- parser.setContentHandler(_treeBuilder);
+ parser.setContentHandler(getContentHandler());
try {
parser.parse(source);
} catch (SAXException e) {
@@ -439,13 +467,11 @@
*/
public synchronized void render(Document document)
throws FOPException {
- StreamRenderer streamRenderer = new StreamRenderer(_stream, _renderer);
- _treeBuilder.setStreamRenderer(streamRenderer);
try {
DocumentInputSource source = new DocumentInputSource(document);
DocumentReader reader = new DocumentReader();
- reader.setContentHandler(_treeBuilder);
+ reader.setContentHandler(getContentHandler());
reader.parse(source);
} catch (SAXException e) {
throw new FOPException(e);
@@ -462,17 +488,17 @@
public void dumpError(Exception e) {
if (_errorDump) {
if (e instanceof SAXException) {
- e.printStackTrace();
+ log.error("", e);
if (((SAXException)e).getException() != null) {
- ((SAXException)e).getException().printStackTrace();
+ log.error("", ((SAXException)e).getException());
}
} else if (e instanceof FOPException) {
e.printStackTrace();
if (((FOPException)e).getException() != null) {
- ((FOPException)e).getException().printStackTrace();
+ log.error("", ((FOPException)e).getException());
}
} else {
- e.printStackTrace();
+ log.error("", e);
}
}
}
1.7 +3 -3 xml-fop/src/org/apache/fop/apps/PDFOutputHandler.java
Index: PDFOutputHandler.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/PDFOutputHandler.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PDFOutputHandler.java 2001/07/30 20:29:18 1.6
+++ PDFOutputHandler.java 2001/08/20 11:19:22 1.7
@@ -1,5 +1,5 @@
/*
- * $Id: PDFOutputHandler.java,v 1.6 2001/07/30 20:29:18 tore Exp $
+ * $Id: PDFOutputHandler.java,v 1.7 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -125,7 +125,7 @@
FontInfo fontInfo = new FontInfo();
this.renderer.setupFontInfo(fontInfo);
- this.areaTree = new AreaTree();
+// this.areaTree = new AreaTree();
this.areaTree.setFontInfo(fontInfo);
format(areaTree);
@@ -137,7 +137,7 @@
* render the area tree to the output form
*/
public void doRender() throws IOException, FOPException {
- this.renderer.render(areaTree, this.stream);
+ //this.renderer.render(areaTree, this.stream);
}
// ////////////////////////////////////////////////////////////////////////////////////
1.5 +8 -1 xml-fop/src/org/apache/fop/apps/Starter.java
Index: Starter.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/Starter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Starter.java 2001/07/30 20:29:18 1.4
+++ Starter.java 2001/08/20 11:19:22 1.5
@@ -1,5 +1,5 @@
/*
- * $Id: Starter.java,v 1.4 2001/07/30 20:29:18 tore Exp $
+ * $Id: Starter.java,v 1.5 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -7,6 +7,8 @@
package org.apache.fop.apps;
+import org.apache.log.*;
+
// SAX
import org.xml.sax.XMLReader;
import org.xml.sax.SAXException;
@@ -27,9 +29,14 @@
Options options;
InputHandler inputHandler;
+ protected Logger log;
public Starter() throws FOPException {
options = new Options();
+ }
+
+ public void setLogger(Logger logger) {
+ log = logger;
}
public void setInputHandler(InputHandler inputHandler) {
1.4 +17 -10 xml-fop/src/org/apache/fop/apps/StreamRenderer.java
Index: StreamRenderer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/StreamRenderer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- StreamRenderer.java 2001/08/06 17:56:35 1.3
+++ StreamRenderer.java 2001/08/20 11:19:22 1.4
@@ -14,8 +14,9 @@
import org.apache.fop.datatypes.IDReferences;
import org.apache.fop.extensions.ExtensionObj;
import org.apache.fop.fo.pagination.PageSequence;
-import org.apache.fop.messaging.MessageHandler;
+import org.apache.log.Logger;
+
/**
This class acts as a bridge between the XML:FO parser
and the formatting/rendering classes. It will queue
@@ -27,7 +28,7 @@
FOTreeBuilder when a PageSequence is created,
and AreaTree when a Page is formatted.<P>
*/
-public class StreamRenderer extends Object {
+public class StreamRenderer {
private static final boolean MEM_PROFILE_WITH_GC = false;
/**
@@ -81,11 +82,17 @@
*/
private IDReferences idReferences = new IDReferences();
+ private Logger log;
+
public StreamRenderer(OutputStream outputStream, Renderer renderer) {
this.outputStream = outputStream;
this.renderer = renderer;
}
+ public void setLogger(Logger logger) {
+ log = logger;
+ }
+
public IDReferences getIDReferences() {
return idReferences;
}
@@ -130,20 +137,20 @@
long memoryNow = runtime.totalMemory() - runtime.freeMemory();
long memoryUsed = (memoryNow - initialMemory) / 1024L;
- MessageHandler.logln("Initial heap size: " + (initialMemory/1024L) + "Kb");
- MessageHandler.logln("Current heap size: " + (memoryNow/1024L) + "Kb");
- MessageHandler.logln("Total memory used: " + memoryUsed + "Kb");
+ log.info("Initial heap size: " + (initialMemory/1024L) + "Kb");
+ log.info("Current heap size: " + (memoryNow/1024L) + "Kb");
+ log.info("Total memory used: " + memoryUsed + "Kb");
if (!MEM_PROFILE_WITH_GC) {
- MessageHandler.logln(" Memory use is indicative; no GC was performed");
- MessageHandler.logln(" These figures should not be used comparatively");
+ log.info(" Memory use is indicative; no GC was performed");
+ log.info(" These figures should not be used comparatively");
}
long timeUsed = System.currentTimeMillis() - startTime;
- MessageHandler.logln("Total time used: " + timeUsed + "ms");
- MessageHandler.logln("Pages rendererd: " + pageCount);
- MessageHandler.logln("Avg render time: " + (timeUsed / pageCount) + "ms/page");
+ log.info("Total time used: " + timeUsed + "ms");
+ log.info("Pages rendererd: " + pageCount);
+ log.info("Avg render time: " + (timeUsed / pageCount) + "ms/page");
}
/**
1.7 +3 -4 xml-fop/src/org/apache/fop/apps/XTDriver.java
Index: XTDriver.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/XTDriver.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XTDriver.java 2001/07/31 12:51:18 1.6
+++ XTDriver.java 2001/08/20 11:19:22 1.7
@@ -1,5 +1,5 @@
/*
- * $Id: XTDriver.java,v 1.6 2001/07/31 12:51:18 keiron Exp $
+ * $Id: XTDriver.java,v 1.7 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -10,7 +10,6 @@
// FOP
import org.apache.fop.fo.XTFOTreeBuilder;
import org.apache.fop.fo.ElementMapping;
-import org.apache.fop.fo.PropertyListMapping;
import org.apache.fop.layout.AreaTree;
import org.apache.fop.layout.FontInfo;
import org.apache.fop.render.Renderer;
@@ -321,7 +320,7 @@
FontInfo fontInfo = new FontInfo();
this.renderer.setupFontInfo(fontInfo);
- this.areaTree = new AreaTree();
+ //this.areaTree = new AreaTree();
this.areaTree.setFontInfo(fontInfo);
this.treeBuilder.format(areaTree);
@@ -331,7 +330,7 @@
* render the area tree to the output form
*/
public void render() throws IOException, FOPException {
- this.renderer.render(areaTree, this.stream);
+ //this.renderer.render(areaTree, this.stream);
}
}
1.4 +1 -2 xml-fop/src/org/apache/fop/datatypes/LengthPair.java
Index: LengthPair.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/datatypes/LengthPair.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LengthPair.java 2001/07/30 20:29:19 1.3
+++ LengthPair.java 2001/08/20 11:19:22 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: LengthPair.java,v 1.3 2001/07/30 20:29:19 tore Exp $
+ * $Id: LengthPair.java,v 1.4 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -7,7 +7,6 @@
package org.apache.fop.datatypes;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.Property;
/**
1.6 +1 -2 xml-fop/src/org/apache/fop/datatypes/LengthRange.java
Index: LengthRange.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/datatypes/LengthRange.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- LengthRange.java 2001/07/30 20:29:19 1.5
+++ LengthRange.java 2001/08/20 11:19:22 1.6
@@ -1,5 +1,5 @@
/*
- * $Id: LengthRange.java,v 1.5 2001/07/30 20:29:19 tore Exp $
+ * $Id: LengthRange.java,v 1.6 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -7,7 +7,6 @@
package org.apache.fop.datatypes;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.Property;
/**
1.3 +1 -3 xml-fop/src/org/apache/fop/datatypes/MixedLength.java
Index: MixedLength.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/datatypes/MixedLength.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MixedLength.java 2001/07/30 20:29:19 1.2
+++ MixedLength.java 2001/08/20 11:19:22 1.3
@@ -1,13 +1,11 @@
/*
- * $Id: MixedLength.java,v 1.2 2001/07/30 20:29:19 tore Exp $
+ * $Id: MixedLength.java,v 1.3 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
package org.apache.fop.datatypes;
-
-import org.apache.fop.messaging.MessageHandler;
/**
* A length quantity in XSL which is specified with a mixture
1.3 +1 -3 xml-fop/src/org/apache/fop/datatypes/PercentLength.java
Index: PercentLength.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/datatypes/PercentLength.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PercentLength.java 2001/07/30 20:29:19 1.2
+++ PercentLength.java 2001/08/20 11:19:22 1.3
@@ -1,13 +1,11 @@
/*
- * $Id: PercentLength.java,v 1.2 2001/07/30 20:29:19 tore Exp $
+ * $Id: PercentLength.java,v 1.3 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
package org.apache.fop.datatypes;
-
-import org.apache.fop.messaging.MessageHandler;
/**
* a percent specified length quantity in XSL
1.3 +1 -3 xml-fop/src/org/apache/fop/datatypes/TableColLength.java
Index: TableColLength.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/datatypes/TableColLength.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TableColLength.java 2001/07/30 20:29:19 1.2
+++ TableColLength.java 2001/08/20 11:19:22 1.3
@@ -1,13 +1,11 @@
/*
- * $Id: TableColLength.java,v 1.2 2001/07/30 20:29:19 tore Exp $
+ * $Id: TableColLength.java,v 1.3 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
*/
package org.apache.fop.datatypes;
-
-import org.apache.fop.messaging.MessageHandler;
/**
* A table-column width specification, possibly including some
1.3 +5 -3 xml-fop/src/org/apache/fop/datatypes/ToBeImplementedProperty.java
Index: ToBeImplementedProperty.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/datatypes/ToBeImplementedProperty.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ToBeImplementedProperty.java 2001/07/30 20:29:19 1.2
+++ ToBeImplementedProperty.java 2001/08/20 11:19:22 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: ToBeImplementedProperty.java,v 1.2 2001/07/30 20:29:19 tore Exp $ --
+ * $Id: ToBeImplementedProperty.java,v 1.3 2001/08/20 11:19:22 keiron Exp $ --
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -8,8 +8,9 @@
package org.apache.fop.datatypes;
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
+import org.apache.log.*;
+
public class ToBeImplementedProperty extends Property {
public static class Maker extends Property.Maker {
@@ -30,7 +31,8 @@
}
public ToBeImplementedProperty(String propName) {
- MessageHandler.errorln("Warning: property - \"" + propName
+ Logger log = Hierarchy.getDefaultHierarchy().getLoggerFor("fop");
+ log.warn("property - \"" + propName
+ "\" is not implemented yet.");
}
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/ColorProfile.java
Index: ColorProfile.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/ColorProfile.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ColorProfile.java 2001/07/30 20:29:20 1.3
+++ ColorProfile.java 2001/08/20 11:19:22 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: ColorProfile.java,v 1.3 2001/07/30 20:29:20 tore Exp $
+ * $Id: ColorProfile.java,v 1.4 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.AreaTree;
1.3 +1 -2 xml-fop/src/org/apache/fop/fo/Declarations.java
Index: Declarations.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Declarations.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Declarations.java 2001/07/30 20:29:20 1.2
+++ Declarations.java 2001/08/20 11:19:22 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: Declarations.java,v 1.2 2001/07/30 20:29:20 tore Exp $
+ * $Id: Declarations.java,v 1.3 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.AreaTree;
1.20 +9 -1 xml-fop/src/org/apache/fop/fo/FONode.java
Index: FONode.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FONode.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- FONode.java 2001/08/01 23:08:54 1.19
+++ FONode.java 2001/08/20 11:19:22 1.20
@@ -1,5 +1,5 @@
/*
- * $Id: FONode.java,v 1.19 2001/08/01 23:08:54 gears Exp $
+ * $Id: FONode.java,v 1.20 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -16,6 +16,8 @@
import org.apache.fop.system.BufferManager;
import org.apache.fop.fo.flow.Marker;
+import org.apache.log.Logger;
+
// Java
import java.util.Vector;
import java.util.Hashtable;
@@ -73,6 +75,8 @@
// markers
protected Hashtable markers;
+ protected Logger log;
+
protected FONode(FObj parent) {
this.parent = parent;
if (parent != null) {
@@ -83,6 +87,10 @@
if (null != parent)
this.areaClass = parent.areaClass;
+ }
+
+ public void setLogger(Logger logger) {
+ log = logger;
}
public void setIsInTableCell() {
1.23 +4 -5 xml-fop/src/org/apache/fop/fo/FOText.java
Index: FOText.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FOText.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- FOText.java 2001/08/01 23:08:54 1.22
+++ FOText.java 2001/08/20 11:19:22 1.23
@@ -1,5 +1,5 @@
/*
- * $Id: FOText.java,v 1.22 2001/08/01 23:08:54 gears Exp $
+ * $Id: FOText.java,v 1.23 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources."
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.layout.Area;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.layout.BlockArea;
import org.apache.fop.layout.FontState;
import org.apache.fop.layout.*;
@@ -106,7 +105,7 @@
// ML - remove refs to BufferManager
// char ca[] = this.bufferManager.readBuffer((Object)this);
if (!(area instanceof BlockArea)) {
- MessageHandler.errorln("WARNING: text outside block area"
+ log.error("WARNING: text outside block area"
+ new String(ca, start, length));
return new Status(Status.OK);
}
@@ -193,8 +192,8 @@
FontVariant.NORMAL);
} catch (FOPException ex) {
smallCapsFontState = fontState;
- MessageHandler.errorln("Error creating small-caps FontState: "
- + ex.getMessage());
+ //log.error("Error creating small-caps FontState: "
+ // + ex.getMessage());
}
// parse text for upper/lower case and call addRealText
1.25 +13 -6 xml-fop/src/org/apache/fop/fo/FOTreeBuilder.java
Index: FOTreeBuilder.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FOTreeBuilder.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- FOTreeBuilder.java 2001/08/15 10:46:59 1.24
+++ FOTreeBuilder.java 2001/08/20 11:19:22 1.25
@@ -1,5 +1,5 @@
/*
- * $Id: FOTreeBuilder.java,v 1.24 2001/08/15 10:46:59 keiron Exp $
+ * $Id: FOTreeBuilder.java,v 1.25 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,13 +9,14 @@
// FOP
import org.apache.fop.layout.AreaTree;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.StreamRenderer;
import org.apache.fop.fo.pagination.Root;
import org.apache.fop.system.BufferManager;
import org.apache.fop.fo.pagination.PageSequence;
+import org.apache.log.Logger;
+
// SAX
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.SAXException;
@@ -75,8 +76,13 @@
*/
private StreamRenderer streamRenderer;
+ private Logger log;
+
public FOTreeBuilder() {}
+ public void setLogger(Logger logger) {
+ log = logger;
+ }
public void setStreamRenderer(StreamRenderer streamRenderer) {
this.streamRenderer = streamRenderer;
@@ -165,13 +171,13 @@
public void startDocument()
throws SAXException {
rootFObj = null; // allows FOTreeBuilder to be reused
- MessageHandler.logln("building formatting object tree");
+ log.info("building formatting object tree");
streamRenderer.startRenderer();
}
public void endDocument()
throws SAXException {
- MessageHandler.logln("Parsing of document complete, stopping renderer");
+ log.info("Parsing of document complete, stopping renderer");
streamRenderer.stopRenderer();
}
@@ -195,7 +201,7 @@
if (fobjMaker == null) {
if (!this.unknownFOs.containsKey(fullName)) {
this.unknownFOs.put(fullName, "");
- MessageHandler.errorln("WARNING: Unknown formatting object "
+ log.error("Unknown formatting object "
+ fullName);
}
fobjMaker = new Unknown.Maker(); // fall back
@@ -215,6 +221,7 @@
list = currentFObj.properties;
}
fobj = fobjMaker.make(currentFObj, list);
+ fobj.setLogger(log);
} catch (FOPException e) {
throw new SAXException(e);
}
@@ -240,7 +247,7 @@
* @param areaTree the area tree to format into
*/
public void format(AreaTree areaTree) throws FOPException {
- MessageHandler.logln("formatting FOs into areas");
+ log.info("formatting FOs into areas");
this.bufferManager.readComplete();
((Root)this.rootFObj).format(areaTree);
}
1.16 +21 -14 xml-fop/src/org/apache/fop/fo/Property.java
Index: Property.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Property.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Property.java 2001/07/30 20:29:20 1.15
+++ Property.java 2001/08/20 11:19:22 1.16
@@ -1,5 +1,5 @@
/*
- * $Id: Property.java,v 1.15 2001/07/30 20:29:20 tore Exp $
+ * $Id: Property.java,v 1.16 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -7,7 +7,6 @@
package org.apache.fop.fo;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.datatypes.*;
import org.apache.fop.fo.expr.Numeric;
import org.apache.fop.fo.expr.PropertyParser;
@@ -16,6 +15,8 @@
import org.apache.fop.apps.FOPException;
import java.util.Vector;
+import org.apache.log.Logger;
+
public class Property {
public static class Maker {
@@ -131,8 +132,8 @@
return setSubprop(baseProp, partName, p);
}
} else {
- MessageHandler.errorln("WARNING: compound property component "
- + partName + " unknown.");
+ //MessageHandler.errorln("WARNING: compound property component "
+ // + partName + " unknown.");
}
return baseProp;
}
@@ -187,9 +188,9 @@
}
return pret;
} catch (org.apache.fop.fo.expr.PropertyException propEx) {
- MessageHandler.errorln("Error in " + propName
- + " property value '" + value + "': "
- + propEx);
+ //MessageHandler.errorln("Error in " + propName
+ // + " property value '" + value + "': "
+ // + propEx);
throw new FOPException("Property error");
}
}
@@ -223,11 +224,11 @@
}
} catch (FOPException e) {
- MessageHandler.errorln("convertShorthandProperty caught FOPException "
- + e);
+ //MessageHandler.errorln("convertShorthandProperty caught FOPException "
+ // + e);
} catch (org.apache.fop.fo.expr.PropertyException propEx) {
- MessageHandler.errorln("convertShorthandProperty caught PropertyException "
- + propEx);
+ //MessageHandler.errorln("convertShorthandProperty caught PropertyException "
+ // + propEx);
}
if (pret != null) {
/*
@@ -332,9 +333,9 @@
return make(propertyList, specVal,
propertyList.getParentFObj());
} catch (FOPException e) {
- MessageHandler.errorln("Error computing property value for "
- + propName + " from "
- + specVal);
+ //MessageHandler.errorln("Error computing property value for "
+ // + propName + " from "
+ // + specVal);
return null;
}
}
@@ -358,6 +359,12 @@
* specified values.
*/
private String specVal;
+
+ protected Logger log;
+
+ public void setLogger(Logger logger) {
+ log = logger;
+ }
/**
* Set the original value specified for the property attribute.
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/Title.java
Index: Title.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Title.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Title.java 2001/08/06 09:12:58 1.3
+++ Title.java 2001/08/20 11:19:22 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: Title.java,v 1.3 2001/08/06 09:12:58 keiron Exp $
+ * $Id: Title.java,v 1.4 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -11,7 +11,6 @@
import org.apache.fop.fo.*;
import org.apache.fop.datatypes.*;
import org.apache.fop.layout.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.AreaTree;
1.3 +2 -3 xml-fop/src/org/apache/fop/fo/ToBeImplementedElement.java
Index: ToBeImplementedElement.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/ToBeImplementedElement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ToBeImplementedElement.java 2001/07/30 20:29:20 1.2
+++ ToBeImplementedElement.java 2001/08/20 11:19:22 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: ToBeImplementedElement.java,v 1.2 2001/07/30 20:29:20 tore Exp $
+ * $Id: ToBeImplementedElement.java,v 1.3 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.Area;
@@ -25,7 +24,7 @@
}
public Status layout(Area area) throws FOPException {
- MessageHandler.logln("This element \"" + this.name
+ log.debug("This element \"" + this.name
+ "\" is not yet implemented.");
return new Status(Status.OK);
}
1.3 +1 -2 xml-fop/src/org/apache/fop/fo/TreeBuilder.java
Index: TreeBuilder.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/TreeBuilder.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TreeBuilder.java 2001/07/30 20:29:20 1.2
+++ TreeBuilder.java 2001/08/20 11:19:22 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: TreeBuilder.java,v 1.2 2001/07/30 20:29:20 tore Exp $
+ * $Id: TreeBuilder.java,v 1.3 2001/08/20 11:19:22 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.layout.AreaTree;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.pagination.Root;
1.2 +2 -3 xml-fop/src/org/apache/fop/fo/Unknown.java
Index: Unknown.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/Unknown.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Unknown.java 2001/08/06 09:12:58 1.1
+++ Unknown.java 2001/08/20 11:19:23 1.2
@@ -1,5 +1,5 @@
/*
- * $Id: Unknown.java,v 1.1 2001/08/06 09:12:58 keiron Exp $
+ * $Id: Unknown.java,v 1.2 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -10,7 +10,6 @@
// FOP
import org.apache.fop.fo.*;
import org.apache.fop.layout.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.AreaTree;
@@ -43,7 +42,7 @@
}
public Status layout(Area area) throws FOPException {
- MessageHandler.logln("Layout Unknown element");
+ log.debug("Layout Unknown element");
return new Status(Status.OK);
}
}
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/flow/BidiOverride.java
Index: BidiOverride.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/BidiOverride.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BidiOverride.java 2001/08/06 09:12:59 1.3
+++ BidiOverride.java 2001/08/20 11:19:23 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: BidiOverride.java,v 1.3 2001/08/06 09:12:59 keiron Exp $
+ * $Id: BidiOverride.java,v 1.4 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -10,7 +10,6 @@
// FOP
import org.apache.fop.fo.*;
import org.apache.fop.layout.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.AreaTree;
1.41 +3 -4 xml-fop/src/org/apache/fop/fo/flow/Block.java
Index: Block.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- Block.java 2001/08/06 09:12:59 1.40
+++ Block.java 2001/08/20 11:19:23 1.41
@@ -1,5 +1,5 @@
/*
- * $Id: Block.java,v 1.40 2001/08/06 09:12:59 keiron Exp $
+ * $Id: Block.java,v 1.41 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
import org.apache.fop.datatypes.*;
@@ -76,7 +75,7 @@
public Status layout(Area area) throws FOPException {
BlockArea blockArea;
- // MessageHandler.error(" b:LAY[" + marker + "] ");
+ // log.error(" b:LAY[" + marker + "] ");
if (this.marker == BREAK_AFTER) {
@@ -337,7 +336,7 @@
return new Status(Status.KEEP_WITH_NEXT);
}
- // MessageHandler.error(" b:OK" + marker + " ");
+ // log.error(" b:OK" + marker + " ");
blockArea.isLast(true);
blockArea = null; // Faster GC - BlockArea is big
return new Status(Status.OK);
1.11 +2 -3 xml-fop/src/org/apache/fop/fo/flow/Character.java
Index: Character.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Character.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Character.java 2001/08/06 09:12:59 1.10
+++ Character.java 2001/08/20 11:19:23 1.11
@@ -1,5 +1,5 @@
/*
- * $Id: Character.java,v 1.10 2001/08/06 09:12:59 keiron Exp $
+ * $Id: Character.java,v 1.11 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -18,7 +18,6 @@
import org.apache.fop.layout.FontState;
import org.apache.fop.layout.LineArea;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.messaging.MessageHandler;
/**
@@ -60,7 +59,7 @@
public Status layout(Area area) throws FOPException {
BlockArea blockArea;
if (!(area instanceof BlockArea)) {
- MessageHandler.errorln("WARNING: currently Character can only be in a BlockArea");
+ log.error("WARNING: currently Character can only be in a BlockArea");
return new Status(Status.OK);
}
blockArea = (BlockArea)area;
1.12 +3 -4 xml-fop/src/org/apache/fop/fo/flow/ExternalGraphic.java
Index: ExternalGraphic.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/ExternalGraphic.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ExternalGraphic.java 2001/08/06 09:12:59 1.11
+++ ExternalGraphic.java 2001/08/20 11:19:23 1.12
@@ -1,5 +1,5 @@
/*
- * $Id: ExternalGraphic.java,v 1.11 2001/08/06 09:12:59 keiron Exp $
+ * $Id: ExternalGraphic.java,v 1.12 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
import org.apache.fop.apps.FOPException;
@@ -236,11 +235,11 @@
} catch (MalformedURLException urlex) {
// bad URL
- MessageHandler.errorln("Error while creating area : "
+ log.error("Error while creating area : "
+ urlex.getMessage());
} catch (FopImageException imgex) {
// image error
- MessageHandler.errorln("Error while creating area : "
+ log.error("Error while creating area : "
+ imgex.getMessage());
}
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/flow/Float.java
Index: Float.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Float.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Float.java 2001/08/06 09:12:59 1.3
+++ Float.java 2001/08/20 11:19:23 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: Float.java,v 1.3 2001/08/06 09:12:59 keiron Exp $
+ * $Id: Float.java,v 1.4 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
1.22 +2 -3 xml-fop/src/org/apache/fop/fo/flow/Flow.java
Index: Flow.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Flow.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Flow.java 2001/07/30 20:29:23 1.21
+++ Flow.java 2001/08/20 11:19:23 1.22
@@ -1,5 +1,5 @@
/*
- * $Id: Flow.java,v 1.21 2001/07/30 20:29:23 tore Exp $
+ * $Id: Flow.java,v 1.22 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -14,7 +14,6 @@
import org.apache.fop.layout.Area;
import org.apache.fop.layout.BodyAreaContainer;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.messaging.MessageHandler;
// Java
import java.util.Hashtable;
@@ -91,7 +90,7 @@
protected void setFlowName(String name) throws FOPException {
if (name == null || name.equals("")) {
- MessageHandler.errorln("WARNING: A 'flow-name' is required for "
+ log.error("WARNING: A 'flow-name' is required for "
+ getElementName()
+ ". This constraint will be enforced in future versions of FOP");
_flowName = "xsl-region-body";
1.5 +2 -2 xml-fop/src/org/apache/fop/fo/flow/Footnote.java
Index: Footnote.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Footnote.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Footnote.java 2001/07/30 20:29:23 1.4
+++ Footnote.java 2001/08/20 11:19:23 1.5
@@ -1,5 +1,5 @@
/*
- * $Id: Footnote.java,v 1.4 2001/07/30 20:29:23 tore Exp $
+ * $Id: Footnote.java,v 1.5 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -65,7 +65,7 @@
}
}
if (fbody == null) {
- MessageHandler.errorln("WARNING: no footnote-body in footnote");
+ log.error("WARNING: no footnote-body in footnote");
}
if (area instanceof BlockArea) {}
return new Status(Status.OK);
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/flow/InitialPropertySet.java
Index: InitialPropertySet.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/InitialPropertySet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- InitialPropertySet.java 2001/08/06 09:12:59 1.3
+++ InitialPropertySet.java 2001/08/20 11:19:23 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: InitialPropertySet.java,v 1.3 2001/08/06 09:12:59 keiron Exp $
+ * $Id: InitialPropertySet.java,v 1.4 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -10,7 +10,6 @@
// FOP
import org.apache.fop.fo.*;
import org.apache.fop.layout.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.AreaTree;
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/flow/InlineContainer.java
Index: InlineContainer.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/InlineContainer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- InlineContainer.java 2001/08/06 09:12:59 1.3
+++ InlineContainer.java 2001/08/20 11:19:23 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: InlineContainer.java,v 1.3 2001/08/06 09:12:59 keiron Exp $
+ * $Id: InlineContainer.java,v 1.4 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
1.10 +3 -4 xml-fop/src/org/apache/fop/fo/flow/Leader.java
Index: Leader.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Leader.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Leader.java 2001/08/06 09:12:59 1.9
+++ Leader.java 2001/08/20 11:19:23 1.10
@@ -1,5 +1,5 @@
/*
- * $Id: Leader.java,v 1.9 2001/08/06 09:12:59 keiron Exp $
+ * $Id: Leader.java,v 1.10 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -17,7 +17,6 @@
import org.apache.fop.layout.LineArea;
import org.apache.fop.layout.FontState;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.messaging.MessageHandler;
/**
* Implements fo:leader; main property of leader leader-pattern.
@@ -48,7 +47,7 @@
BlockArea blockArea;
// restriction in this version
if (!(area instanceof BlockArea)) {
- MessageHandler.errorln("WARNING: in this version of Fop fo:leader must be a direct child of fo:block ");
+ log.error("WARNING: in this version of Fop fo:leader must be a direct child of fo:block ");
return new Status(Status.OK);
} else {
blockArea = (BlockArea)area;
@@ -198,7 +197,7 @@
ruleStyle, ruleThickness, leaderPatternWidth,
leaderAlignment);
} else {
- MessageHandler.errorln("Leader doesn't fit into line, it will be clipped to fit.");
+ log.error("Leader doesn't fit into line, it will be clipped to fit.");
la.addLeader(leaderPattern, la.getRemainingWidth(),
leaderLengthOptimum, leaderLengthMaximum,
ruleStyle, ruleThickness, leaderPatternWidth,
1.21 +2 -3 xml-fop/src/org/apache/fop/fo/flow/ListBlock.java
Index: ListBlock.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/ListBlock.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ListBlock.java 2001/08/06 09:12:59 1.20
+++ ListBlock.java 2001/08/20 11:19:23 1.21
@@ -1,5 +1,5 @@
/*
- * $Id: ListBlock.java,v 1.20 2001/08/06 09:12:59 keiron Exp $
+ * $Id: ListBlock.java,v 1.21 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.datatypes.*;
import org.apache.fop.layout.*;
@@ -143,7 +142,7 @@
int numChildren = this.children.size();
for (int i = this.marker; i < numChildren; i++) {
if (!(children.elementAt(i) instanceof ListItem)) {
- MessageHandler.errorln("children of list-blocks must be list-items");
+ log.error("children of list-blocks must be list-items");
return new Status(Status.OK);
}
ListItem listItem = (ListItem)children.elementAt(i);
1.5 +2 -3 xml-fop/src/org/apache/fop/fo/flow/Marker.java
Index: Marker.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Marker.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Marker.java 2001/07/30 20:29:23 1.4
+++ Marker.java 2001/08/20 11:19:23 1.5
@@ -1,5 +1,5 @@
/*
- * $Id: Marker.java,v 1.4 2001/07/30 20:29:23 tore Exp $
+ * $Id: Marker.java,v 1.5 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
import org.apache.fop.datatypes.*;
@@ -46,7 +45,7 @@
try {
parent.addMarker(this);
} catch (FOPException fopex) {
- MessageHandler.error("marker cannot be added to '" + parent
+ log.error("marker cannot be added to '" + parent
+ "'");
}
}
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/flow/MultiCase.java
Index: MultiCase.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/MultiCase.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MultiCase.java 2001/08/06 09:12:59 1.3
+++ MultiCase.java 2001/08/20 11:19:23 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: MultiCase.java,v 1.3 2001/08/06 09:12:59 keiron Exp $
+ * $Id: MultiCase.java,v 1.4 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/flow/MultiProperties.java
Index: MultiProperties.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/MultiProperties.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MultiProperties.java 2001/08/06 09:12:59 1.3
+++ MultiProperties.java 2001/08/20 11:19:23 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: MultiProperties.java,v 1.3 2001/08/06 09:12:59 keiron Exp $
+ * $Id: MultiProperties.java,v 1.4 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/flow/MultiPropertySet.java
Index: MultiPropertySet.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/MultiPropertySet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MultiPropertySet.java 2001/08/06 09:12:59 1.3
+++ MultiPropertySet.java 2001/08/20 11:19:23 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: MultiPropertySet.java,v 1.3 2001/08/06 09:12:59 keiron Exp $
+ * $Id: MultiPropertySet.java,v 1.4 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/flow/MultiSwitch.java
Index: MultiSwitch.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/MultiSwitch.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MultiSwitch.java 2001/08/06 09:12:59 1.3
+++ MultiSwitch.java 2001/08/20 11:19:23 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: MultiSwitch.java,v 1.3 2001/08/06 09:12:59 keiron Exp $
+ * $Id: MultiSwitch.java,v 1.4 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/flow/MultiToggle.java
Index: MultiToggle.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/MultiToggle.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MultiToggle.java 2001/08/06 09:12:59 1.3
+++ MultiToggle.java 2001/08/20 11:19:23 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: MultiToggle.java,v 1.3 2001/08/06 09:12:59 keiron Exp $
+ * $Id: MultiToggle.java,v 1.4 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
1.20 +2 -3 xml-fop/src/org/apache/fop/fo/flow/PageNumber.java
Index: PageNumber.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/PageNumber.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- PageNumber.java 2001/08/06 09:12:59 1.19
+++ PageNumber.java 2001/08/20 11:19:23 1.20
@@ -1,5 +1,5 @@
/*
- * $Id: PageNumber.java,v 1.19 2001/08/06 09:12:59 keiron Exp $
+ * $Id: PageNumber.java,v 1.20 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -10,7 +10,6 @@
// FOP
import org.apache.fop.fo.*;
import org.apache.fop.layout.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.datatypes.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
@@ -47,7 +46,7 @@
public Status layout(Area area) throws FOPException {
if (!(area instanceof BlockArea)) {
- MessageHandler.errorln("WARNING: page-number outside block area");
+ log.error("WARNING: page-number outside block area");
return new Status(Status.OK);
}
if (this.marker == START) {
1.18 +2 -3 xml-fop/src/org/apache/fop/fo/flow/PageNumberCitation.java
Index: PageNumberCitation.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/PageNumberCitation.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- PageNumberCitation.java 2001/08/06 09:12:59 1.17
+++ PageNumberCitation.java 2001/08/20 11:19:23 1.18
@@ -1,5 +1,5 @@
/*
- * $Id: PageNumberCitation.java,v 1.17 2001/08/06 09:12:59 keiron Exp $
+ * $Id: PageNumberCitation.java,v 1.18 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.pagination.*;
import org.apache.fop.datatypes.*;
import org.apache.fop.fo.properties.*;
@@ -105,7 +104,7 @@
public Status layout(Area area) throws FOPException {
if (!(area instanceof BlockArea)) {
- MessageHandler.errorln("WARNING: page-number-citation outside block area");
+ log.error("WARNING: page-number-citation outside block area");
return new Status(Status.OK);
}
1.6 +1 -2 xml-fop/src/org/apache/fop/fo/flow/RetrieveMarker.java
Index: RetrieveMarker.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/RetrieveMarker.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RetrieveMarker.java 2001/07/30 20:29:23 1.5
+++ RetrieveMarker.java 2001/08/20 11:19:23 1.6
@@ -1,5 +1,5 @@
/*
- * $Id: RetrieveMarker.java,v 1.5 2001/07/30 20:29:23 tore Exp $
+ * $Id: RetrieveMarker.java,v 1.6 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
import org.apache.fop.datatypes.*;
1.16 +2 -3 xml-fop/src/org/apache/fop/fo/flow/StaticContent.java
Index: StaticContent.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/StaticContent.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- StaticContent.java 2001/07/30 20:29:23 1.15
+++ StaticContent.java 2001/08/20 11:19:23 1.16
@@ -1,5 +1,5 @@
/*
- * $Id: StaticContent.java,v 1.15 2001/07/30 20:29:23 tore Exp $
+ * $Id: StaticContent.java,v 1.16 2001/08/20 11:19:23 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -13,7 +13,6 @@
import org.apache.fop.fo.pagination.*;
import org.apache.fop.layout.Area;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.messaging.MessageHandler;
// Java
import java.util.Enumeration;
@@ -78,7 +77,7 @@
Status status;
if ((status = fo.layout(area)).isIncomplete()) {
// in fact all should be laid out and clip, error etc depending on 'overflow'
- MessageHandler.logln("Warning: Some static content could not fit in the area.");
+ log.debug("Warning: Some static content could not fit in the area.");
this.marker = i;
if ((i != 0) && (status.getCode() == Status.AREA_FULL_NONE)) {
status = new Status(Status.AREA_FULL_SOME);
1.34 +5 -6 xml-fop/src/org/apache/fop/fo/flow/Table.java
Index: Table.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Table.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- Table.java 2001/08/06 09:12:59 1.33
+++ Table.java 2001/08/20 11:19:23 1.34
@@ -1,5 +1,5 @@
/*
- * -- $Id: Table.java,v 1.33 2001/08/06 09:12:59 keiron Exp $ --
+ * -- $Id: Table.java,v 1.34 2001/08/20 11:19:23 keiron Exp $ --
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
import org.apache.fop.datatypes.*;
@@ -199,21 +198,21 @@
FONode fo = (FONode)children.elementAt(i);
if (fo instanceof TableHeader) {
if (columns.size() == 0) {
- MessageHandler.errorln("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
+ log.error("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
return new Status(Status.OK);
}
tableHeader = (TableHeader)fo;
tableHeader.setColumns(columns);
} else if (fo instanceof TableFooter) {
if (columns.size() == 0) {
- MessageHandler.errorln("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
+ log.error("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
return new Status(Status.OK);
}
tableFooter = (TableFooter)fo;
tableFooter.setColumns(columns);
} else if (fo instanceof TableBody) {
if (columns.size() == 0) {
- MessageHandler.errorln("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
+ log.error("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
return new Status(Status.OK);
}
Status status;
@@ -291,7 +290,7 @@
// from the last table body and place it on the
// next page so that it can have a footer at
// the end of the table.
- MessageHandler.errorln("WARNING: footer could not fit on page, moving last body row to next page");
+ log.error("WARNING: footer could not fit on page, moving last body row to next page");
area.addChild(areaContainer);
area.increaseHeight(areaContainer.getHeight());
area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/flow/TableAndCaption.java
Index: TableAndCaption.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableAndCaption.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TableAndCaption.java 2001/08/06 09:12:59 1.3
+++ TableAndCaption.java 2001/08/20 11:19:23 1.4
@@ -1,5 +1,5 @@
/*
- * -- $Id: TableAndCaption.java,v 1.3 2001/08/06 09:12:59 keiron Exp $ --
+ * -- $Id: TableAndCaption.java,v 1.4 2001/08/20 11:19:23 keiron Exp $ --
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
1.4 +1 -2 xml-fop/src/org/apache/fop/fo/flow/TableCaption.java
Index: TableCaption.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableCaption.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TableCaption.java 2001/08/06 09:12:59 1.3
+++ TableCaption.java 2001/08/20 11:19:23 1.4
@@ -1,5 +1,5 @@
/*
- * -- $Id: TableCaption.java,v 1.3 2001/08/06 09:12:59 keiron Exp $ --
+ * -- $Id: TableCaption.java,v 1.4 2001/08/20 11:19:23 keiron Exp $ --
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.*;
1.51 +1 -2 xml-fop/src/org/apache/fop/fo/flow/TableRow.java
Index: TableRow.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableRow.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- TableRow.java 2001/08/06 09:12:59 1.50
+++ TableRow.java 2001/08/20 11:19:23 1.51
@@ -1,5 +1,5 @@
/*
- * -- $Id: TableRow.java,v 1.50 2001/08/06 09:12:59 keiron Exp $ --
+ * -- $Id: TableRow.java,v 1.51 2001/08/20 11:19:23 keiron Exp $ --
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.datatypes.*;
import org.apache.fop.layout.*;
1.4 +3 -4 xml-fop/src/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
Index: ConditionalPageMasterReference.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ConditionalPageMasterReference.java 2001/07/30 20:29:25 1.3
+++ ConditionalPageMasterReference.java 2001/08/20 11:19:24 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: ConditionalPageMasterReference.java,v 1.3 2001/07/30 20:29:25 tore Exp $
+ * $Id: ConditionalPageMasterReference.java,v 1.4 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -10,7 +10,6 @@
import org.apache.fop.fo.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.messaging.MessageHandler;
public class ConditionalPageMasterReference extends FObj {
@@ -75,7 +74,7 @@
break;
case PagePosition.LAST:
// how the hell do you know at this point?
- MessageHandler.log("LAST PagePosition NYI");
+ log.debug("LAST PagePosition NYI");
okOnPagePosition = true;
break;
case PagePosition.REST:
@@ -148,7 +147,7 @@
(RepeatablePageMasterAlternatives)parent;
if (getMasterName() == null) {
- MessageHandler.errorln("WARNING: single-page-master-reference"
+ log.error("WARNING: single-page-master-reference"
+ "does not have a master-name and so is being ignored");
} else {
this.repeatablePageMasterAlternatives.addConditionalPageMasterReference(this);
1.4 +2 -3 xml-fop/src/org/apache/fop/fo/pagination/PageMasterReference.java
Index: PageMasterReference.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageMasterReference.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PageMasterReference.java 2001/07/30 20:29:25 1.3
+++ PageMasterReference.java 2001/08/20 11:19:24 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: PageMasterReference.java,v 1.3 2001/07/30 20:29:25 tore Exp $
+ * $Id: PageMasterReference.java,v 1.4 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -10,7 +10,6 @@
import org.apache.fop.fo.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.messaging.MessageHandler;
/**
* Base PageMasterReference class. Provides implementation for handling the
@@ -72,7 +71,7 @@
_pageSequenceMaster = (PageSequenceMaster)parent;
if (getMasterName() == null) {
- MessageHandler.errorln("WARNING: " + getElementName()
+ log.error("WARNING: " + getElementName()
+ " does not have a master-name and so is being ignored");
} else {
_pageSequenceMaster.addSubsequenceSpecifier(this);
1.3 +11 -4 xml-fop/src/org/apache/fop/fo/pagination/PageNumberGenerator.java
Index: PageNumberGenerator.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageNumberGenerator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PageNumberGenerator.java 2001/07/30 20:29:25 1.2
+++ PageNumberGenerator.java 2001/08/20 11:19:24 1.3
@@ -1,5 +1,5 @@
/*
- * $Id: PageNumberGenerator.java,v 1.2 2001/07/30 20:29:25 tore Exp $
+ * $Id: PageNumberGenerator.java,v 1.3 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -8,8 +8,9 @@
package org.apache.fop.fo.pagination;
import org.apache.fop.fo.properties.*;
-import org.apache.fop.messaging.MessageHandler;
+import org.apache.log.*;
+
// Java
import java.util.*;
@@ -41,6 +42,8 @@
"", "0", "00", "000", "0000", "00000"
};
+ private Logger log;
+
public PageNumberGenerator(String format, char groupingSeparator,
int groupingSize, int letterValue) {
this.format = format;
@@ -65,7 +68,7 @@
formatType = UPPERROMAN;
} else {
// token not handled
- MessageHandler.log("'format' token not recognized; using '1'");
+ //log.debug("'format' token not recognized; using '1'");
formatType = DECIMAL;
minPadding = 0;
}
@@ -75,7 +78,7 @@
// loop
for (int i = 0; i < fmtLen - 1; i++) {
if (format.charAt(i) != '0') {
- MessageHandler.log("'format' token not recognized; using '1'");
+ //log.debug("'format' token not recognized; using '1'");
formatType = DECIMAL;
minPadding = 0;
} else {
@@ -83,6 +86,10 @@
}
}
}
+ }
+
+ public void setLogger(Logger logger) {
+ log = logger;
}
public String makeFormattedPageNumber(int number) {
1.38 +9 -12 xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java
Index: PageSequence.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- PageSequence.java 2001/08/01 23:08:54 1.37
+++ PageSequence.java 2001/08/20 11:19:24 1.38
@@ -1,5 +1,5 @@
/*
- * $Id: PageSequence.java,v 1.37 2001/08/01 23:08:54 gears Exp $
+ * $Id: PageSequence.java,v 1.38 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -14,7 +14,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.fo.flow.Flow;
import org.apache.fop.fo.flow.StaticContent;
@@ -200,7 +199,7 @@
throw new FOPException("flow-names must be unique within an fo:page-sequence");
}
if (!this.layoutMasterSet.regionNameExists(flow.getFlowName())) {
- MessageHandler.errorln("WARNING: region-name '"
+ log.error("WARNING: region-name '"
+ flow.getFlowName()
+ "' doesn't exist in the layout-master-set.");
}
@@ -273,7 +272,7 @@
currentPage.setFormattedNumber(formattedPageNumber);
this.root.setRunningPageNumberCounter(this.currentPageNumber);
- MessageHandler.log(" [" + currentPageNumber);
+ log.info(" [" + currentPageNumber);
if ((status.getCode() == Status.FORCE_PAGE_BREAK_EVEN)
&& ((currentPageNumber % 2) == 1)) {}
@@ -286,7 +285,7 @@
Flow flow = getCurrentFlow(RegionBody.REGION_CLASS);
if (null == flow) {
- MessageHandler.errorln("No flow found for region-body "
+ log.error("No flow found for region-body "
+ "in page-master '"
+ currentPageMasterName + "'");
break;
@@ -302,7 +301,7 @@
currentPage.setPageSequence(this);
formatStaticContent(areaTree);
- MessageHandler.log("]");
+ log.info("]");
areaTree.addPage(currentPage);
this.pageCount++; // used for 'force-page-count' calculations
}
@@ -311,8 +310,6 @@
forcePage(areaTree, firstAvailPageNumber);
currentPage = null;
-
- MessageHandler.logln("");
}
/**
@@ -415,7 +412,7 @@
AreaContainer beforeArea = currentPage.getBefore();
((StaticContent)flow).layout(area, region);
} else {
- MessageHandler.errorln("WARNING: " + region.getName()
+ log.error("WARNING: " + region.getName()
+ " only supports static-content flows currently. Cannot use flow named '"
+ flow.getFlowName() + "'");
}
@@ -479,7 +476,7 @@
SubSequenceSpecifier nextSubsequence =
getNextSubsequence(sequenceMaster);
if (nextSubsequence == null) {
- MessageHandler.errorln("\nWARNING: Page subsequences exhausted. Using previous subsequence.");
+ log.error("\nWARNING: Page subsequences exhausted. Using previous subsequence.");
thisIsFirstPage =
true; // this becomes the first page in the new (old really) page master
currentSubsequence.reset();
@@ -674,12 +671,12 @@
currentPage.setFormattedNumber(formattedPageNumber);
currentPage.setPageSequence(this);
formatStaticContent(areaTree);
- MessageHandler.log("[forced-" + firstAvailPageNumber + "]");
+ log.debug("[forced-" + firstAvailPageNumber + "]");
areaTree.addPage(currentPage);
this.root.setRunningPageNumberCounter(this.currentPageNumber);
this.isForcing = false;
} catch (FOPException fopex) {
- MessageHandler.log("'force-page-count' failure");
+ log.debug("'force-page-count' failure");
}
}
}
1.5 +2 -3 xml-fop/src/org/apache/fop/fo/pagination/PageSequenceMaster.java
Index: PageSequenceMaster.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageSequenceMaster.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PageSequenceMaster.java 2001/07/30 20:29:25 1.4
+++ PageSequenceMaster.java 2001/08/20 11:19:24 1.5
@@ -1,5 +1,5 @@
/*
- * $Id: PageSequenceMaster.java,v 1.4 2001/07/30 20:29:25 tore Exp $
+ * $Id: PageSequenceMaster.java,v 1.5 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -12,7 +12,6 @@
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.PageMaster;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.messaging.MessageHandler;
// Java
import java.util.*;
@@ -52,7 +51,7 @@
this.layoutMasterSet = (LayoutMasterSet)parent;
String pm = this.properties.get("master-name").getString();
if (pm == null) {
- MessageHandler.errorln("WARNING: page-sequence-master does not have "
+ log.error("WARNING: page-sequence-master does not have "
+ "a page-master-name and so is being ignored");
} else {
this.layoutMasterSet.addPageSequenceMaster(pm, this);
1.11 +3 -4 xml-fop/src/org/apache/fop/fo/pagination/RegionBody.java
Index: RegionBody.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionBody.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- RegionBody.java 2001/07/30 20:29:25 1.10
+++ RegionBody.java 2001/08/20 11:19:24 1.11
@@ -1,5 +1,5 @@
/*
- * $Id: RegionBody.java,v 1.10 2001/07/30 20:29:25 tore Exp $
+ * $Id: RegionBody.java,v 1.11 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -18,7 +18,6 @@
import org.apache.fop.layout.BorderAndPadding;
import org.apache.fop.layout.BackgroundProps;
import org.apache.fop.layout.MarginProps;
-import org.apache.fop.messaging.MessageHandler;
public class RegionBody extends Region {
@@ -83,13 +82,13 @@
try {
columnCount = Integer.parseInt(columnCountAsString);
} catch (NumberFormatException nfe) {
- MessageHandler.errorln("Bad value on region body 'column-count'");
+ log.error("Bad value on region body 'column-count'");
columnCount = 1;
}
if ((columnCount > 1) && (overflow == Overflow.SCROLL)) {
// recover by setting 'column-count' to 1. This is allowed but
// not required by the spec.
- MessageHandler.errorln("Setting 'column-count' to 1 because "
+ log.error("Setting 'column-count' to 1 because "
+ "'overflow' is set to 'scroll'");
columnCount = 1;
}
1.7 +1 -2 xml-fop/src/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
Index: RepeatablePageMasterAlternatives.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- RepeatablePageMasterAlternatives.java 2001/07/30 20:29:25 1.6
+++ RepeatablePageMasterAlternatives.java 2001/08/20 11:19:24 1.7
@@ -1,5 +1,5 @@
/*
- * $Id: RepeatablePageMasterAlternatives.java,v 1.6 2001/07/30 20:29:25 tore Exp $
+ * $Id: RepeatablePageMasterAlternatives.java,v 1.7 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
import org.apache.fop.fo.*;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.messaging.MessageHandler;
// Java
import java.util.Vector;
1.15 +2 -3 xml-fop/src/org/apache/fop/fo/pagination/Root.java
Index: Root.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Root.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Root.java 2001/07/30 20:29:25 1.14
+++ Root.java 2001/08/20 11:19:24 1.15
@@ -1,5 +1,5 @@
/*
- * $Id: Root.java,v 1.14 2001/07/30 20:29:25 tore Exp $
+ * $Id: Root.java,v 1.15 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.flow.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.AreaTree;
@@ -104,7 +103,7 @@
}
public void format(AreaTree areaTree) throws FOPException {
- // MessageHandler.errorln(" Root[" + marker + "] ");
+ // log.debug(" Root[" + marker + "] ");
if (layoutMasterSet == null) {
throw new FOPException("No layout master set.");
}
1.14 +3 -4 xml-fop/src/org/apache/fop/fo/pagination/SimplePageMaster.java
Index: SimplePageMaster.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/SimplePageMaster.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- SimplePageMaster.java 2001/07/30 20:29:25 1.13
+++ SimplePageMaster.java 2001/08/20 11:19:24 1.14
@@ -1,5 +1,5 @@
/*
- * $Id: SimplePageMaster.java,v 1.13 2001/07/30 20:29:25 tore Exp $
+ * $Id: SimplePageMaster.java,v 1.14 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -9,7 +9,6 @@
// FOP
import org.apache.fop.fo.*;
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.fo.properties.*;
import org.apache.fop.layout.PageMaster;
import org.apache.fop.layout.RegionArea;
@@ -58,7 +57,7 @@
this.layoutMasterSet = (LayoutMasterSet)parent;
masterName = this.properties.get("master-name").getString();
if (masterName == null) {
- MessageHandler.errorln("WARNING: simple-page-master does not have "
+ log.error("WARNING: simple-page-master does not have "
+ "a master-name and so is being ignored");
} else {
this.layoutMasterSet.addSimplePageMaster(this);
@@ -99,7 +98,7 @@
contentRectangleHeight);
this.pageMaster.addBody(body);
} else {
- MessageHandler.errorln("ERROR: simple-page-master must have a region of class "
+ log.error("ERROR: simple-page-master must have a region of class "
+ RegionBody.REGION_CLASS);
}
1.4 +1 -4 xml-fop/src/org/apache/fop/fo/pagination/SinglePageMasterReference.java
Index: SinglePageMasterReference.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/SinglePageMasterReference.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SinglePageMasterReference.java 2001/07/30 20:29:25 1.3
+++ SinglePageMasterReference.java 2001/08/20 11:19:24 1.4
@@ -1,5 +1,5 @@
/*
- * $Id: SinglePageMasterReference.java,v 1.3 2001/07/30 20:29:25 tore Exp $
+ * $Id: SinglePageMasterReference.java,v 1.4 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -8,7 +8,6 @@
import org.apache.fop.fo.*;
import org.apache.fop.apps.FOPException;
-import org.apache.fop.messaging.MessageHandler;
public class SinglePageMasterReference extends PageMasterReference
implements SubSequenceSpecifier {
@@ -53,10 +52,8 @@
this.state = FIRST;
}
-
protected String getElementName() {
return "fo:single-page-master-reference";
}
-
}
1.6 +16 -6 xml-fop/src/org/apache/fop/messaging/MessageHandler.java
Index: MessageHandler.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/messaging/MessageHandler.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MessageHandler.java 2001/07/30 20:29:29 1.5
+++ MessageHandler.java 2001/08/20 11:19:24 1.6
@@ -10,6 +10,7 @@
import java.io.*;
import java.util.*;
+import org.apache.log.*;
/**
* The class MessageHandler contains the static methods log and error which
@@ -79,16 +80,22 @@
}
}
+ // temp workaround
+ private static Logger logger = null;
+
/**
* informs the user of the message
* @param message the message for the user
*/
public static void log(String message) {
if (!quiet) {
+ if(logger == null) {
+ logger = Hierarchy.getDefaultHierarchy().getLoggerFor("fop");
+ }
setMessage(message);
switch (outputMethod) {
case SCREEN:
- System.out.print(getMessage());
+ logger.debug(getMessage());
break;
case FILE:
if (fileOpened) {
@@ -111,7 +118,7 @@
// do nothing
break;
default:
- System.out.print(message);
+ logger.debug(message);
}
}
}
@@ -121,7 +128,7 @@
* @param message the message for the user
*/
public static void logln(String message) {
- log(message + "\n");
+ log(message);
}
/**
@@ -130,10 +137,13 @@
*/
public static void error(String errorMessage) {
+ if(logger == null) {
+ logger = Hierarchy.getDefaultHierarchy().getLoggerFor("fop");
+ }
setMessage(errorMessage);
switch (outputMethod) {
case SCREEN:
- System.err.print(getMessage());
+ logger.error(getMessage());
break;
case FILE:
if (fileOpened) {
@@ -158,7 +168,7 @@
// do nothing
break;
default:
- System.err.print(errorMessage);
+ logger.error(errorMessage);
}
}
@@ -167,7 +177,7 @@
* @param errorMessage the message for the user
*/
public static void errorln(String errorMessage) {
- error(errorMessage + "\n");
+ error(errorMessage);
}
/**
1.12 +19 -9 xml-fop/src/org/apache/fop/tools/TestConverter.java
Index: TestConverter.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/tools/TestConverter.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- TestConverter.java 2001/08/15 11:31:27 1.11
+++ TestConverter.java 2001/08/20 11:19:24 1.12
@@ -1,5 +1,5 @@
/*
- * $Id: TestConverter.java,v 1.11 2001/08/15 11:31:27 keiron Exp $
+ * $Id: TestConverter.java,v 1.12 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -10,6 +10,8 @@
import org.apache.fop.apps.*;
import org.apache.fop.configuration.*;
+import org.apache.log.*;
+
import java.io.*;
import java.util.*;
@@ -41,6 +43,7 @@
File compare = null;
String baseDir = "./";
Hashtable differ = new Hashtable();
+ private Logger log;
/**
* This main method can be used to run the test converter from
@@ -77,8 +80,13 @@
tc.runTests(testFile, "results", null);
}
- public TestConverter() {}
+ public TestConverter() {
+ setupLogging();
+ }
+ private void setupLogging() {
+ log = Hierarchy.getDefaultHierarchy().getLoggerFor("testing");
+ }
public void setOutputPDF(boolean pdf) {
outputPDF = pdf;
@@ -98,7 +106,7 @@
* The document is read as a dom and each testcase is covered.
*/
public Hashtable runTests(String fname, String dest, String compDir) {
- // System.out.println("running tests in file:" + fname);
+ log.debug("running tests in file:" + fname);
try {
if (compDir != null) {
compare = new File(baseDir + "/" + compDir);
@@ -122,7 +130,7 @@
if (testsuite.hasAttributes()) {
String profile =
testsuite.getAttributes().getNamedItem("profile").getNodeValue();
- // System.out.println("testing test suite:" + profile);
+ log.debug("testing test suite:" + profile);
}
NodeList testcases = testsuite.getChildNodes();
@@ -148,7 +156,7 @@
if (tcase.hasAttributes()) {
String profile =
tcase.getAttributes().getNamedItem("profile").getNodeValue();
- // System.out.println("testing profile:" + profile);
+ log.debug("testing profile:" + profile);
}
NodeList cases = tcase.getChildNodes();
@@ -192,8 +200,8 @@
if (xslNode != null) {
xsl = xslNode.getNodeValue();
}
- // System.out.println("converting xml:" + xml + " and xsl:" +
- // xsl + " to area tree");
+ log.debug("converting xml:" + xml + " and xsl:" +
+ xsl + " to area tree");
try {
File xmlFile = new File(baseDir + "/" + xml);
@@ -202,7 +210,7 @@
Configuration.put("baseDir",
xmlFile.getParentFile().toURL().toExternalForm());
} catch (Exception e) {
- System.err.println("Error setting base directory");
+ log.error("Error setting base directory");
}
InputHandler inputHandler = null;
@@ -217,7 +225,9 @@
XMLReader parser = inputHandler.getParser();
setParserFeatures(parser);
+ Logger logger = log.getChildLogger("fop");
Driver driver = new Driver();
+ driver.setLogger(logger);
if (outputPDF) {
driver.setRenderer(Driver.RENDER_PDF);
} else {
@@ -236,7 +246,7 @@
}
driver.setOutputStream(new FileOutputStream(new File(destdir,
outname + (outputPDF ? ".pdf" : ".at.xml"))));
- // System.out.println("ddir:" + destdir + " on:" + outname + ".pdf");
+ log.debug("ddir:" + destdir + " on:" + outname + ".pdf");
driver.render(parser, inputHandler.getInputSource());
// check difference
1.10 +29 -8 xml-fop/src/org/apache/fop/tools/anttasks/Fop.java
Index: Fop.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/tools/anttasks/Fop.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Fop.java 2001/07/30 20:29:35 1.9
+++ Fop.java 2001/08/20 11:19:24 1.10
@@ -1,5 +1,5 @@
/*
- * $Id: Fop.java,v 1.9 2001/07/30 20:29:35 tore Exp $
+ * $Id: Fop.java,v 1.10 2001/08/20 11:19:24 keiron Exp $
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -10,6 +10,10 @@
// Ant
import org.apache.tools.ant.*;
+import org.apache.log.*;
+import org.apache.log.format.*;
+import org.apache.log.output.io.*;
+import org.apache.log.output.*;
// SAX
import org.xml.sax.XMLReader;
@@ -143,13 +147,30 @@
class FOPTaskStarter extends Starter {
Fop task;
- MessageLogger logger;
+ Logger log;
FOPTaskStarter(Fop task) throws FOPException {
this.task = task;
- MessageHandler.setOutputMethod(MessageHandler.EVENT);
- logger = new MessageLogger(new MessageHandler(), task);
- logger.setMessageLevel(task.getMessageType());
+
+ Hierarchy hierarchy = new Hierarchy();
+ // PatternFormatter formatter = new PatternFormatter(
+ // "[%{priority}] %{category}: %{message}\n%{throwable}" );
+ PatternFormatter formatter = new PatternFormatter("%{message}\n%{throwable}");
+
+ LogTarget target = null;
+ boolean doConsoleLogging = true;
+ if (doConsoleLogging) {
+ target = new StreamTarget(System.out, formatter);
+ } else {
+ try {
+ File f = new File("fop.log");
+ target = new FileTarget(f, false, formatter);
+ } catch (IOException e) {}
+ }
+
+ hierarchy.setDefaultLogTarget(target);
+ log = hierarchy.getLoggerFor("fop");
+ log.setPriority(Priority.INFO);
}
public void run() throws FOPException {
@@ -169,7 +190,7 @@
try {
pdfOut = new FileOutputStream(task.getPdffile());
} catch (Exception ex) {
- MessageHandler.errorln("Failed to open " + task.getPdffile());
+ log.error("Failed to open " + task.getPdffile());
throw new BuildException(ex);
}
@@ -180,14 +201,14 @@
try {
Driver driver = new Driver(inputHandler.getInputSource(), pdfOut);
+ driver.setLogger(log);
driver.setRenderer(Driver.RENDER_PDF);
driver.setXMLReader(parser);
driver.run();
} catch (Exception ex) {
- MessageHandler.logln("Error: " + ex.getMessage());
+ log.error("Couldn't render pdf: " + ex.getMessage());
throw new BuildException(ex);
}
- logger.die();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org