Starter starter = options.getStarter();
starter.run();
} catch (FOPException e) {
- MessageHandler.errorln("ERROR: " + e.getMessage());
+ MessageHandler.errorln("" + e.getMessage());
if (options != null && options.isDebugMode().booleanValue()) {
e.printStackTrace();
}
} catch (java.io.FileNotFoundException e) {
- MessageHandler.errorln("ERROR: " + e.getMessage());
+ MessageHandler.errorln("" + e.getMessage());
if (options != null && options.isDebugMode().booleanValue()) {
e.printStackTrace();
}
long memoryNow = runtime.totalMemory() - runtime.freeMemory();
long memoryUsed = (memoryNow - initialMemory) / 1024L;
- log.info("Initial heap size: " + (initialMemory/1024L) + "Kb");
- log.info("Current heap size: " + (memoryNow/1024L) + "Kb");
- log.info("Total memory used: " + memoryUsed + "Kb");
+ log.debug("Initial heap size: " + (initialMemory/1024L) + "Kb");
+ log.debug("Current heap size: " + (memoryNow/1024L) + "Kb");
+ log.debug("Total memory used: " + memoryUsed + "Kb");
if (!MEM_PROFILE_WITH_GC) {
- log.info(" Memory use is indicative; no GC was performed");
- log.info(" These figures should not be used comparatively");
+ log.debug(" Memory use is indicative; no GC was performed");
+ log.debug(" These figures should not be used comparatively");
}
long timeUsed = System.currentTimeMillis() - startTime;
- log.info("Total time used: " + timeUsed + "ms");
- log.info("Pages rendererd: " + pageCount);
- log.info("Avg render time: " + (timeUsed / pageCount) + "ms/page");
+ log.debug("Total time used: " + timeUsed + "ms");
+ log.debug("Pages rendererd: " + pageCount);
+ log.debug("Avg render time: " + (timeUsed / pageCount) + "ms/page");
}
/**
this.red = 0;
this.green = 0;
this.blue = 0;
- MessageHandler.errorln("ERROR: unknown colour format. Must be #RGB or #RRGGBB");
+ MessageHandler.errorln("unknown colour format. Must be #RGB or #RRGGBB");
}
} catch (Exception e) {
this.red = 0;
this.green = 0;
this.blue = 0;
- MessageHandler.errorln("ERROR: unknown colour format. Must be #RGB or #RRGGBB");
+ MessageHandler.errorln("unknown colour format. Must be #RGB or #RRGGBB");
}
} else if (value.startsWith("rgb(")) {
int poss = value.indexOf("(");
this.red = 0;
this.green = 0;
this.blue = 0;
- MessageHandler.errorln("ERROR: unknown colour format. Must be #RGB or #RRGGBB");
+ MessageHandler.errorln("unknown colour format. Must be #RGB or #RRGGBB");
}
}
} else if (value.startsWith("url(")) {
this.red = 0;
this.green = 0;
this.blue = 0;
- MessageHandler.errorln("ERROR: unknown colour name: "
+ MessageHandler.errorln("unknown colour name: "
+ value);
}
}
dvalue = dvalue * assumed_resolution;
else {
dvalue = 0;
- MessageHandler.errorln("ERROR: unknown length unit '" + unit
+ MessageHandler.errorln("unknown length unit '" + unit
+ "'");
}
this.millipoints = (int)(dvalue * 1000);
* // if minimum is explicit, force max to min
* if ((bfSet&MAXSET)!=0) {
* // Warning: min>max, resetting max to min
- * MessageHandler.errorln("WARNING: forcing max to min in LengthRange");
+ * MessageHandler.errorln("forcing max to min in LengthRange");
* }
* maximum = minimum ;
* }
* if ((bfSet&OPTSET)!=0) {
* if ((bfSet&MAXSET)!=0) {
* // Warning: opt > max, resetting opt to max
- * MessageHandler.errorln("WARNING: forcing opt to max in LengthRange");
+ * MessageHandler.errorln("forcing opt to max in LengthRange");
* optimum = maximum ;
* }
* else {
* if ((bfSet&MINSET)!=0) {
* // if minimum is explicit, force opt to min
* if ((bfSet&OPTSET)!=0) {
- * MessageHandler.errorln("WARNING: forcing opt to min in LengthRange");
+ * MessageHandler.errorln("forcing opt to min in LengthRange");
* }
* optimum = minimum ;
* }
* Called by subclass if no match found.
*/
public Property checkEnumValues(String value) {
- MessageHandler.errorln("WARNING: Unknown enumerated value for property '"
+ MessageHandler.errorln("Unknown enumerated value for property '"
+ getPropName() + "': " + value);
return null;
}
// ML - remove refs to BufferManager
// char ca[] = this.bufferManager.readBuffer((Object)this);
if (!(area instanceof BlockArea)) {
- log.error("WARNING: text outside block area"
+ log.error("text outside block area"
+ new String(ca, start, length));
return new Status(Status.OK);
}
return setSubprop(baseProp, partName, p);
}
} else {
- //MessageHandler.errorln("WARNING: compound property component "
+ //MessageHandler.errorln("compound property component "
// + partName + " unknown.");
}
return baseProp;
try {
p = propertyMaker.compute(propertyList);
} catch (FOPException e) {
- MessageHandler.errorln("ERROR: exception occurred while computing"
+ MessageHandler.errorln("exception occurred while computing"
+ " value of property '"
+ propertyName + "': "
+ e.getMessage());
}
} else {
- MessageHandler.errorln("WARNING: property " + propertyName
+ MessageHandler.errorln("property " + propertyName
+ " ignored");
}
return p;
if (propertyMaker != null) {
b = propertyMaker.isInherited();
} else {
- // MessageHandler.errorln("WARNING: Unknown property " + propertyName);
+ // MessageHandler.errorln("Unknown property " + propertyName);
b = true;
}
return b;
}
} else {
if (!attributeName.startsWith("xmlns"))
- MessageHandler.errorln("WARNING: property '"
+ MessageHandler.errorln("property '"
+ attributeName + "' ignored");
}
}
if (propertyMaker != null) {
return propertyMaker.isCorrespondingForced(propertyList);
} else {
- MessageHandler.errorln("WARNING: no Maker for " + propertyName);
+ MessageHandler.errorln("no Maker for " + propertyName);
}
return false;
}
if (propertyMaker != null) {
return propertyMaker.getShorthand(propertyList);
} else {
- MessageHandler.errorln("WARNING: no Maker for " + propertyName);
+ MessageHandler.errorln("no Maker for " + propertyName);
return null;
}
}
if (propertyMaker != null) {
p = propertyMaker.make(propertyList);
} else {
- MessageHandler.errorln("WARNING: property " + propertyName
+ MessageHandler.errorln("property " + propertyName
+ " ignored");
}
return p;
public Status layout(Area area) throws FOPException {
BlockArea blockArea;
if (!(area instanceof BlockArea)) {
- log.error("WARNING: currently Character can only be in a BlockArea");
+ log.warn("currently Character can only be in a BlockArea");
return new Status(Status.OK);
}
blockArea = (BlockArea)area;
protected void setFlowName(String name) throws FOPException {
if (name == null || name.equals("")) {
- log.error("WARNING: A 'flow-name' is required for "
+ log.warn("A 'flow-name' is required for "
+ getElementName()
+ ". This constraint will be enforced in future versions of FOP");
_flowName = "xsl-region-body";
}
}
if (fbody == null) {
- log.error("WARNING: no footnote-body in footnote");
+ log.error("no footnote-body in footnote");
}
if (area instanceof BlockArea) {}
return new Status(Status.OK);
BlockArea blockArea;
// restriction in this version
if (!(area instanceof BlockArea)) {
- log.error("WARNING: in this version of Fop fo:leader must be a direct child of fo:block ");
+ log.warn("in this version of Fop fo:leader must be a direct child of fo:block ");
return new Status(Status.OK);
} else {
blockArea = (BlockArea)area;
public Status layout(Area area) throws FOPException {
if (!(area instanceof BlockArea)) {
- log.error("WARNING: page-number outside block area");
+ log.warn("page-number outside block area");
return new Status(Status.OK);
}
if (this.marker == START) {
public Status layout(Area area) throws FOPException {
if (!(area instanceof BlockArea)) {
- log.error("WARNING: page-number-citation outside block area");
+ log.warn("page-number-citation outside block area");
return new Status(Status.OK);
}
FONode fo = (FONode)children.elementAt(i);
if (fo instanceof TableHeader) {
if (columns.size() == 0) {
- log.error("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
+ log.warn("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) {
- log.error("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
+ log.warn("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) {
- log.error("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
+ log.warn("current implementation of tables requires a table-column for each column, indicating column-width");
return new Status(Status.OK);
}
Status status;
// 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.
- log.error("WARNING: footer could not fit on page, moving last body row to next page");
+ log.warn("footer could not fit on page, moving last body row to next page");
area.addChild(areaContainer);
area.increaseHeight(areaContainer.getHeight());
area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
(RepeatablePageMasterAlternatives)parent;
if (getMasterName() == null) {
- log.error("WARNING: single-page-master-reference"
+ log.warn("single-page-master-reference"
+ "does not have a master-name and so is being ignored");
} else {
this.repeatablePageMasterAlternatives.addConditionalPageMasterReference(this);
_pageSequenceMaster = (PageSequenceMaster)parent;
if (getMasterName() == null) {
- log.error("WARNING: " + getElementName()
+ log.warn("" + getElementName()
+ " does not have a master-name and so is being ignored");
} else {
_pageSequenceMaster.addSubsequenceSpecifier(this);
throw new FOPException("flow-names must be unique within an fo:page-sequence");
}
if (!this.layoutMasterSet.regionNameExists(flow.getFlowName())) {
- log.error("WARNING: region-name '"
+ log.error("region-name '"
+ flow.getFlowName()
+ "' doesn't exist in the layout-master-set.");
}
currentPage.setFormattedNumber(formattedPageNumber);
this.root.setRunningPageNumberCounter(this.currentPageNumber);
- log.info(" [" + currentPageNumber);
+ log.info("[" + currentPageNumber + "]");
if ((status.getCode() == Status.FORCE_PAGE_BREAK_EVEN)
&& ((currentPageNumber % 2) == 1)) {}
currentPage.setPageSequence(this);
formatStaticContent(areaTree);
- log.info("]");
+ //log.info("]");
areaTree.addPage(currentPage);
this.pageCount++; // used for 'force-page-count' calculations
}
AreaContainer beforeArea = currentPage.getBefore();
((StaticContent)flow).layout(area, region);
} else {
- log.error("WARNING: " + region.getName()
+ log.error("" + region.getName()
+ " only supports static-content flows currently. Cannot use flow named '"
+ flow.getFlowName() + "'");
}
SubSequenceSpecifier nextSubsequence =
getNextSubsequence(sequenceMaster);
if (nextSubsequence == null) {
- log.error("\nWARNING: Page subsequences exhausted. Using previous subsequence.");
+ log.error("Page subsequences exhausted. Using previous subsequence.");
thisIsFirstPage =
true; // this becomes the first page in the new (old really) page master
currentSubsequence.reset();
this.layoutMasterSet = (LayoutMasterSet)parent;
String pm = this.properties.get("master-name").getString();
if (pm == null) {
- log.error("WARNING: page-sequence-master does not have "
+ log.warn("page-sequence-master does not have "
+ "a page-master-name and so is being ignored");
} else {
this.layoutMasterSet.addPageSequenceMaster(pm, this);
this.layoutMasterSet = (LayoutMasterSet)parent;
masterName = this.properties.get("master-name").getString();
if (masterName == null) {
- log.error("WARNING: simple-page-master does not have "
+ log.warn("simple-page-master does not have "
+ "a master-name and so is being ignored");
} else {
this.layoutMasterSet.addSimplePageMaster(this);
contentRectangleHeight);
this.pageMaster.addBody(body);
} else {
- log.error("ERROR: simple-page-master must have a region of class "
+ log.error("simple-page-master must have a region of class "
+ RegionBody.REGION_CLASS);
}
new SAXSVGDocumentFactory(SVGImage.getParserName());
doc = factory.createDocument(this.m_href.toExternalForm());
} catch (Exception e) {
- MessageHandler.errorln("ERROR LOADING EXTERNAL SVG: "
+ MessageHandler.errorln("Could not load external SVG: "
+ e.getMessage());
}
}
MessageHandler.errorln("Batik not in class path");
return false;
} catch (Exception e) {
- MessageHandler.errorln("ERROR LOADING EXTERNAL SVG: "
+ MessageHandler.errorln("Could not load external SVG: "
+ e.getMessage());
// assuming any exception means this document is not svg
// or could not be loaded for some reason
if (f == null) {
throw new FOPException("no default font defined by OutputConverter");
}
- MessageHandler.errorln("WARNING: defaulted font to any,normal,normal");
+ MessageHandler.errorln("defaulted font to any,normal,normal");
}
- MessageHandler.errorln("WARNING: unknown font " + key
+ MessageHandler.errorln("unknown font " + key
+ " so defaulted font to any");
}
int xpos = xoffset + (x / 100);
if (xpos < 0) {
xpos = 0;
- log.error("PCLRenderer.addRect() WARNING: Horizontal position out of bounds.");
+ log.warn("Horizontal position out of bounds.");
}
currentStream.add("\033*v1O\033&a" + xpos + "h"
xpos = xoffset + ((x + 240) / 100);
if (xpos < 0) {
xpos = 0;
- log.error("PCLRenderer.addRect() WARNING: Horizontal position out of bounds.");
+ log.warn("Horizontal position out of bounds.");
}
currentStream.add("\033&a" + xpos + "h"
+ (pageHeight - ((y + 240)) / 100) + "V"
int xpos = xoffset + (x / 100);
if (xpos < 0) {
xpos = 0;
- log.error("PCLRenderer.renderImageArea() WARNING: Horizontal position out of bounds.");
+ log.warn("Horizontal position out of bounds.");
}
currentStream.add("\033&a" + xpos + "h" + (pageHeight - (y / 100))
int xpos = xoffset + (rx / 100);
if (xpos < 0) {
xpos = 0;
- log.error("PCLRenderer.renderWordArea() WARNING: Horizontal position out of bounds.");
+ log.warn("Horizontal position out of bounds.");
}
currentStream.add("\033&a" + xpos + "h" + (pageHeight - (bl / 100))
+ "V" + s);
import org.apache.fop.configuration.*;
import org.apache.log.*;
+import org.apache.log.format.*;
+import org.apache.log.output.io.*;
+import org.apache.log.output.*;
import java.io.*;
import java.util.*;
}
private void setupLogging() {
- log = Hierarchy.getDefaultHierarchy().getLoggerFor("test");
+ 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("test");
+ log.setPriority(Priority.ERROR);
}
public void setOutputPDF(boolean pdf) {