diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-04-11 09:20:13 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-04-11 10:35:04 +0200 |
commit | 6de0b1710adfba82c96b75a5da6f52633a54c692 (patch) | |
tree | cf7255c64f90884a65536bee4af1131231649c91 /reportbuilder/java | |
parent | d9f10d8f0f6bae31dd5ebd9fa00f989d17fc21da (diff) |
Get rid of apache-commons-logging
...using Java 1.4 java.util.logging.Logger instead also for the last remaining
uses in reportbuilder.
(The mention in swext/mediawiki/src/THIRDPARTYLICENSEREADME.html was presumably
a leftover from 4b6ceed4a4a9b152905a8b1712ffb9bd61373c16 "swext: Wiki Publisher
does not use those apache-commons libraries".)
Change-Id: Ia0bc598fe5844ced11cae497548ec7d09453a99d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113939
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'reportbuilder/java')
14 files changed, 82 insertions, 105 deletions
diff --git a/reportbuilder/java/org/libreoffice/report/SDBCReportDataFactory.java b/reportbuilder/java/org/libreoffice/report/SDBCReportDataFactory.java index 463addc63e71..b3c4508666ca 100644 --- a/reportbuilder/java/org/libreoffice/report/SDBCReportDataFactory.java +++ b/reportbuilder/java/org/libreoffice/report/SDBCReportDataFactory.java @@ -58,9 +58,6 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Very primitive implementation, just to show how this could be used ... @@ -142,7 +139,7 @@ public class SDBCReportDataFactory implements DataSourceFactory private int parameterCount = 0; private final ArrayList<Integer> parameterIndex = new ArrayList<Integer>(); } - private static final Log LOGGER = LogFactory.getLog(SDBCReportDataFactory.class); + private static final Logger LOGGER = Logger.getLogger(SDBCReportDataFactory.class.getName()); public static final String COMMAND_TYPE = "command-type"; public static final String ESCAPE_PROCESSING = "escape-processing"; public static final String SORT_EXPRESSIONS = "sort-expressions"; @@ -259,7 +256,7 @@ public class SDBCReportDataFactory implements DataSourceFactory } catch (SQLException ex) { - LOGGER.error("ReportProcessing failed / getOrderStatement could not get quote character", ex); + LOGGER.severe("ReportProcessing failed / getOrderStatement could not get quote character: " + ex); // fall back to the SQL standard quote=""; } diff --git a/reportbuilder/java/org/libreoffice/report/StorageRepository.java b/reportbuilder/java/org/libreoffice/report/StorageRepository.java index 8b6d08c458a2..a338ee5dedb5 100644 --- a/reportbuilder/java/org/libreoffice/report/StorageRepository.java +++ b/reportbuilder/java/org/libreoffice/report/StorageRepository.java @@ -37,9 +37,7 @@ import java.io.BufferedOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.util.logging.Logger; /** * A directory holds all the contents here. @@ -49,8 +47,8 @@ import org.apache.commons.logging.LogFactory; public class StorageRepository implements InputRepository, OutputRepository { - private static final Log LOGGER = LogFactory.getLog(StorageRepository.class); - private static final String REPORT_PROCESSING_FAILED = "ReportProcessing failed"; + private static final Logger LOGGER = Logger.getLogger(StorageRepository.class.getName()); + private static final String REPORT_PROCESSING_FAILED = "ReportProcessing failed: "; private XStorage input; private XStorage output; private final String rootURL; @@ -134,11 +132,11 @@ public class StorageRepository implements InputRepository, OutputRepository } catch (InvalidStorageException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (com.sun.star.lang.IllegalArgumentException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (NoSuchElementException e) { @@ -168,15 +166,15 @@ public class StorageRepository implements InputRepository, OutputRepository } catch (InvalidStorageException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (com.sun.star.lang.IllegalArgumentException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (NoSuchElementException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } return false; } @@ -195,23 +193,23 @@ public class StorageRepository implements InputRepository, OutputRepository } catch (NoSuchElementException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (WrappedTargetException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (InvalidStorageException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (IllegalArgumentException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (com.sun.star.io.IOException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } throw new IOException(); } @@ -245,27 +243,27 @@ public class StorageRepository implements InputRepository, OutputRepository } catch (UnknownPropertyException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (PropertyVetoException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (IllegalArgumentException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (WrappedTargetException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (InvalidStorageException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (com.sun.star.io.IOException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } throw new IOException(); @@ -293,11 +291,11 @@ public class StorageRepository implements InputRepository, OutputRepository } catch (com.sun.star.io.IOException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (WrappedTargetException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } output.dispose(); } @@ -312,11 +310,11 @@ public class StorageRepository implements InputRepository, OutputRepository } catch (InvalidStorageException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (com.sun.star.lang.IllegalArgumentException ex) { - LOGGER.error(REPORT_PROCESSING_FAILED, ex); + LOGGER.severe(REPORT_PROCESSING_FAILED + ex); } catch (NoSuchElementException ex) { diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/Manifest.mf b/reportbuilder/java/org/libreoffice/report/pentaho/Manifest.mf index 23731b104054..2a56b2fbb9fa 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/Manifest.mf +++ b/reportbuilder/java/org/libreoffice/report/pentaho/Manifest.mf @@ -3,5 +3,5 @@ Class-Path: reportbuilderwizard.jar flute-1.1.6.jar libserializer-1.1.6.jar libbase-1.1.6.jar libfonts-1.1.6.jar libformula-1.1.7.jar liblayout.jar libloader-1.1.6.jar librepository-1.1.6.jar libxml-1.1.7.jar - flow-engine.jar sac.jar commons-logging-1.2.jar + flow-engine.jar sac.jar UNO-Type-Path: diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportJob.java b/reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportJob.java index 480bca548e7e..efb4261ce127 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportJob.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/PentahoReportJob.java @@ -42,9 +42,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.util.logging.Logger; import org.jfree.report.expressions.Expression; import org.jfree.report.expressions.FormulaExpression; @@ -72,7 +70,7 @@ import org.pentaho.reporting.libraries.resourceloader.ResourceManager; public class PentahoReportJob implements ReportJob { - private static final Log LOGGER = LogFactory.getLog(PentahoReportJob.class); + private static final Logger LOGGER = Logger.getLogger(PentahoReportJob.class.getName()); private final DataSourceFactory dataSourceFactory; private final OutputRepository outputRepository; private final JobProperties jobProperties; @@ -235,7 +233,7 @@ public class PentahoReportJob implements ReportJob } catch (ParseException ex) { - LOGGER.error("ReportProcessing failed", ex); + LOGGER.severe("ReportProcessing failed: " + ex); } } else if (node instanceof OfficeDetailSection) @@ -338,7 +336,7 @@ public class PentahoReportJob implements ReportJob rp.processReport(job); job.close(); final long endTime = System.currentTimeMillis(); - LOGGER.debug("Report processing time: " + (endTime - startTime)); + LOGGER.config("Report processing time: " + (endTime - startTime)); } catch (final Exception e) { diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java b/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java index 54694fd619ab..3c52473e3d3c 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/SOReportJobFactory.java @@ -68,9 +68,6 @@ import java.io.Writer; import java.io.PrintWriter; import java.io.StringWriter; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * This class capsulates the class, that implements the minimal component, a factory for creating the service * (<CODE>__getComponentFactory</CODE>) and a method, that writes the information into the given registry key @@ -86,7 +83,7 @@ public class SOReportJobFactory public static class _SOReportJobFactory extends WeakBase implements XInitialization, XServiceInfo, XJob, XPropertySet, ReportJobFactory { - private static final Log LOGGER = LogFactory.getLog(_SOReportJobFactory.class); + private static final Logger LOGGER = Logger.getLogger(_SOReportJobFactory.class.getName()); /** * The service name, that must be used to get an instance of this service. */ @@ -242,7 +239,7 @@ public class SOReportJobFactory } catch (java.lang.Exception e) { - LOGGER.error("ReportProcessing failed", e); + LOGGER.severe("ReportProcessing failed: " + e); Writer result = new StringWriter(); PrintWriter printWriter = new PrintWriter(result); e.printStackTrace(printWriter); @@ -254,7 +251,7 @@ public class SOReportJobFactory } catch (java.lang.IncompatibleClassChangeError e) { - LOGGER.error("Detected an IncompatibleClassChangeError"); + LOGGER.severe("Detected an IncompatibleClassChangeError"); Writer result = new StringWriter(); PrintWriter printWriter = new PrintWriter(result); e.printStackTrace(printWriter); diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java index 6a1bd00736ee..eab7c512284d 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java @@ -208,7 +208,7 @@ public class FormatValueUtility if (result == null) { // ignore it. Ignoring it is much better than printing 'null'. - // LOGGER.debug("Formula '" + formulaExpression.getFormula() + "' evaluated to null."); + // LOGGER.config("Formula '" + formulaExpression.getFormula() + "' evaluated to null."); return null; } else if (result instanceof DataFlags) diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormattedTextLayoutController.java b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormattedTextLayoutController.java index 7f1470edc866..7959b5857408 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormattedTextLayoutController.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormattedTextLayoutController.java @@ -20,8 +20,7 @@ package org.libreoffice.report.pentaho.layoutprocessor; import org.libreoffice.report.pentaho.OfficeNamespaces; import org.libreoffice.report.pentaho.model.FormattedTextElement; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.util.logging.Logger; import org.jfree.report.DataFlags; import org.jfree.report.DataSourceException; @@ -45,7 +44,7 @@ public class FormattedTextLayoutController extends AbstractReportElementLayoutController { - private static final Log LOGGER = LogFactory.getLog(FormattedTextLayoutController.class); + private static final Logger LOGGER = Logger.getLogger(FormattedTextLayoutController.class.getName()); @Override public boolean isValueChanged() @@ -62,7 +61,7 @@ public class FormattedTextLayoutController } catch (final ParseException e) { - LOGGER.debug("Parse Exception", e); + LOGGER.config("Parse Exception: " + e); return false; } } diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/ImageElementLayoutController.java b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/ImageElementLayoutController.java index 0bf40b9dcd28..6fc68e816f7c 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/ImageElementLayoutController.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/ImageElementLayoutController.java @@ -22,8 +22,7 @@ import org.libreoffice.report.OfficeToken; import org.libreoffice.report.pentaho.OfficeNamespaces; import org.libreoffice.report.pentaho.model.ImageElement; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.util.logging.Logger; import org.jfree.layouting.util.AttributeMap; import org.jfree.report.DataSourceException; @@ -59,7 +58,7 @@ public class ImageElementLayoutController extends AbstractReportElementLayoutController { - private static final Log LOGGER = LogFactory.getLog(ImageElementLayoutController.class); + private static final Logger LOGGER = Logger.getLogger(ImageElementLayoutController.class.getName()); private ImageElementContext context; @Override @@ -116,7 +115,7 @@ public class ImageElementLayoutController final LayoutController cellController = findParentCell(); if (cellController == null) { - LOGGER.warn("Image is not contained in a table. Unable to calculate the image-size."); + LOGGER.warning("Image is not contained in a table. Unable to calculate the image-size."); return null; } final Element tableCell = (Element) cellController.getNode(); @@ -124,14 +123,14 @@ public class ImageElementLayoutController final int colSpan = TextUtilities.parseInt((String) tableCell.getAttribute(OfficeNamespaces.TABLE_NS, "number-columns-spanned"), 1); if (rowSpan < 1 || colSpan < 1) { - LOGGER.warn("Rowspan or colspan for image-size calculation was invalid."); + LOGGER.warning("Rowspan or colspan for image-size calculation was invalid."); return null; } final LayoutController rowController = cellController.getParent(); if (rowController == null) { - LOGGER.warn("Table-Cell has no parent. Unable to calculate the image-size."); + LOGGER.warning("Table-Cell has no parent. Unable to calculate the image-size."); return null; } final Section tableRow = (Section) rowController.getNode(); @@ -141,14 +140,14 @@ public class ImageElementLayoutController final int columnPos = findNodeInSection(tableRow, tableCell, OfficeToken.COVERED_TABLE_CELL); if (columnPos == -1) { - LOGGER.warn("Table-Cell is not a direct child of the table-row. Unable to calculate the image-size."); + LOGGER.warning("Table-Cell is not a direct child of the table-row. Unable to calculate the image-size."); return null; } final LayoutController tableController = rowController.getParent(); if (tableController == null) { - LOGGER.warn("Table-Row has no Table. Unable to calculate the image-size."); + LOGGER.warning("Table-Row has no Table. Unable to calculate the image-size."); return null; } @@ -158,7 +157,7 @@ public class ImageElementLayoutController if (columns.getNodeCount() <= columnPos + colSpan) { // the colspan is too large. The table definition is therefore invalid. We do not try to fix this. - LOGGER.warn( + LOGGER.warning( "The Table's defined columns do not match the col-span or col-position. Unable to calculate the image-size."); return null; } @@ -169,7 +168,7 @@ public class ImageElementLayoutController final int rowPos = findNodeInSection(table, tableRow, null); if (rowPos == -1) { - LOGGER.warn("Table-Cell is not a direct child of the table-row. Unable to calculate the image-size."); + LOGGER.warning("Table-Cell is not a direct child of the table-row. Unable to calculate the image-size."); return null; } diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/output/ImageProducer.java b/reportbuilder/java/org/libreoffice/report/pentaho/output/ImageProducer.java index ae1a8273bfb7..69995d7aa1c5 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/output/ImageProducer.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/output/ImageProducer.java @@ -48,9 +48,6 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import org.jfree.layouting.input.style.values.CSSNumericType; import org.jfree.layouting.input.style.values.CSSNumericValue; @@ -67,7 +64,7 @@ import org.pentaho.reporting.libraries.base.util.WaitingImageObserver; public class ImageProducer { - private static final Log LOGGER = LogFactory.getLog(ImageProducer.class); + private static final Logger LOGGER = Logger.getLogger(ImageProducer.class.getName()); public static class OfficeImage { @@ -188,7 +185,7 @@ public class ImageProducer final boolean preserveIRI) { - LOGGER.debug("Want to produce image " + imageData); + LOGGER.config("Want to produce image " + imageData); if (imageData instanceof String) { return produceFromString((String) imageData, preserveIRI); @@ -247,11 +244,11 @@ public class ImageProducer } catch (IOException e) { - LOGGER.warn("Failed to produce image from Blob", e); + LOGGER.warning("Failed to produce image from Blob: " + e); } catch (SQLException e) { - LOGGER.warn("Failed to produce image from Blob", e); + LOGGER.warning("Failed to produce image from Blob: " + e); } return null; } @@ -295,11 +292,11 @@ public class ImageProducer } catch (IOException e) { - LOGGER.warn("Failed to load image from local input-repository", e); + LOGGER.warning("Failed to load image from local input-repository: " + e); } catch (ReportExecutionException e) { - LOGGER.warn("Failed to create image from local input-repository", e); + LOGGER.warning("Failed to create image from local input-repository: " + e); } return null; } @@ -353,11 +350,11 @@ public class ImageProducer } catch (IOException e) { - LOGGER.warn("Failed to load image from local input-repository", e); + LOGGER.warning("Failed to load image from local input-repository: " + e); } catch (ReportExecutionException e) { - LOGGER.warn("Failed to create image from local input-repository", e); + LOGGER.warning("Failed to create image from local input-repository: " + e); } } else @@ -435,11 +432,11 @@ public class ImageProducer } catch (IOException e) { - LOGGER.warn("Failed to load image from local input-repository", e); + LOGGER.warning("Failed to load image from local input-repository: " + e); } catch (ReportExecutionException e) { - LOGGER.warn("Failed to create image from local input-repository", e); + LOGGER.warning("Failed to create image from local input-repository: " + e); } if (!preserveIRI) diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java index a5c3be135a65..b73b5781b3a3 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java @@ -65,9 +65,6 @@ import java.util.Map; import java.util.zip.DeflaterOutputStream; import java.util.zip.InflaterInputStream; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import org.jfree.layouting.input.style.parser.CSSValueFactory; import org.jfree.layouting.input.style.parser.StyleSheetParserUtil; import org.jfree.layouting.input.style.values.CSSNumericType; @@ -112,7 +109,7 @@ import org.w3c.css.sac.LexicalUnit; public abstract class OfficeDocumentReportTarget extends AbstractReportTarget { - protected static final Log LOGGER = LogFactory.getLog(OfficeDocumentReportTarget.class); + protected static final Logger LOGGER = Logger.getLogger(OfficeDocumentReportTarget.class.getName()); public static final String HORIZONTAL_POS = "horizontal-pos"; public static final String TAG_DEF_PREFIX = "org.libreoffice.report.pentaho.output."; private static final int ROLE_NONE = 0; @@ -517,7 +514,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget // todo if (DEBUG_ELEMENTS) { - LOGGER.debug("Starting " + getCurrentState() + '/' + states.size() + ' ' + ReportTargetUtil.getNamespaceFromAttribute(attrs) + " -> " + ReportTargetUtil.getElemenTypeFromAttribute(attrs)); + LOGGER.config("Starting " + getCurrentState() + '/' + states.size() + ' ' + ReportTargetUtil.getNamespaceFromAttribute(attrs) + " -> " + ReportTargetUtil.getElemenTypeFromAttribute(attrs)); } try { @@ -713,7 +710,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget } catch (IOException ioe) { - LOGGER.error("ReportProcessing failed", ioe); + LOGGER.severe("ReportProcessing failed: " + ioe); throw new ReportProcessingException("Failed to write content", ioe); } } @@ -762,7 +759,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget if (styleMapper.isListOfStyles(elementNamespace, elementName, attrNamespace, attrName)) { // ignored for now. - LOGGER.warn("List of styles is not yet implemented."); + LOGGER.warning("List of styles is not yet implemented."); continue; } @@ -970,7 +967,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget if (DEBUG_ELEMENTS) { - LOGGER.debug("Finished " + getCurrentState() + "/" + states.size() + " " + ReportTargetUtil.getNamespaceFromAttribute(attrs) + ":" + ReportTargetUtil.getElemenTypeFromAttribute(attrs)); + LOGGER.config("Finished " + getCurrentState() + "/" + states.size() + " " + ReportTargetUtil.getNamespaceFromAttribute(attrs) + ":" + ReportTargetUtil.getElemenTypeFromAttribute(attrs)); } } @@ -1153,7 +1150,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget } catch (IOException e) { - LOGGER.error("ReportProcessing failed", e); + LOGGER.severe("ReportProcessing failed: " + e); } return state; } @@ -1294,7 +1291,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget final CSSNumericValue height = image.getHeight(); // always in 100th of a mm - LOGGER.debug("Image " + imageData + " Width: " + width + ", Height: " + height); + LOGGER.config("Image " + imageData + " Width: " + width + ", Height: " + height); if (width == null || height == null) { return; @@ -1313,7 +1310,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget if (imageAreaWidthVal == null || imageAreaHeightVal == null) { - LOGGER.debug("Image data returned from context is invalid. Maybe this is not an image?"); + LOGGER.config("Image data returned from context is invalid. Maybe this is not an image?"); return; } else @@ -1410,7 +1407,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget } else { - LOGGER.debug("There is no image-context, so we have to rely on the image's natural bounds. " + "This may go awfully wrong."); + LOGGER.config("There is no image-context, so we have to rely on the image's natural bounds. " + "This may go awfully wrong."); imageAreaWidthVal = image.getWidth(); imageAreaHeightVal = image.getHeight(); } @@ -1427,7 +1424,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget frameList.setAttribute(OfficeNamespaces.SVG_NS, "y", posY.getValue() + posY.getType().getType()); - LOGGER.debug("Image " + imageData + " A-Width: " + imageAreaWidthVal + ", A-Height: " + imageAreaHeightVal); + LOGGER.config("Image " + imageData + " A-Width: " + imageAreaWidthVal + ", A-Height: " + imageAreaHeightVal); if (imageAreaWidthVal != null) { diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/output/OleProducer.java b/reportbuilder/java/org/libreoffice/report/pentaho/output/OleProducer.java index 2010a189be1d..27f3c25a4b4b 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/output/OleProducer.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/output/OleProducer.java @@ -32,14 +32,12 @@ import org.libreoffice.report.pentaho.PentahoReportEngineMetaData; import java.io.IOException; import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.util.logging.Logger; public class OleProducer { - private static final Log LOGGER = LogFactory.getLog(OleProducer.class); + private static final Logger LOGGER = Logger.getLogger(OleProducer.class.getName()); private final InputRepository inputRepository; private final OutputRepository outputRepository; private final DefaultNameGenerator nameGenerator; @@ -100,16 +98,16 @@ public class OleProducer } catch (ReportExecutionException ex) { - LOGGER.error("ReportProcessing failed", ex); + LOGGER.severe("ReportProcessing failed: " + ex); } catch (IOException ex) { - LOGGER.error("ReportProcessing failed", ex); + LOGGER.severe("ReportProcessing failed: " + ex); } } catch (IOException ex) { - LOGGER.error("ReportProcessing failed", ex); + LOGGER.severe("ReportProcessing failed: " + ex); } finally { if (subInputRepository != null) diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/output/StyleUtilities.java b/reportbuilder/java/org/libreoffice/report/pentaho/output/StyleUtilities.java index 2b204a4bf502..98af0c3fa076 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/output/StyleUtilities.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/output/StyleUtilities.java @@ -28,9 +28,7 @@ import org.libreoffice.report.pentaho.model.OfficeStylesCollection; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.util.logging.Logger; import org.jfree.report.ReportProcessingException; import org.jfree.report.structure.Element; @@ -46,7 +44,7 @@ import org.jfree.report.util.AttributeNameGenerator; public class StyleUtilities { - private static final Log LOGGER = LogFactory.getLog(StyleUtilities.class); + private static final Logger LOGGER = Logger.getLogger(StyleUtilities.class.getName()); private static final String STYLE = "style"; private StyleUtilities() @@ -180,7 +178,7 @@ public class StyleUtilities } else if (styleParent != null) { - LOGGER.warn("Inconsistent styles: " + styleFamily + ":" + styleParent + " does not exist."); + LOGGER.warning("Inconsistent styles: " + styleFamily + ":" + styleParent + " does not exist."); } return preStyle; } @@ -301,7 +299,7 @@ public class StyleUtilities } else { - LOGGER.warn("Dangling data style: " + styleName); + LOGGER.warning("Dangling data style: " + styleName); derivedStyle = null; } } diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java b/reportbuilder/java/org/libreoffice/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java index e6c234503c22..b1d979e7b788 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java @@ -305,7 +305,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } catch (IOException ex) { - LOGGER.error("ReportProcessing failed", ex); + LOGGER.severe("ReportProcessing failed: " + ex); } } } diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/parser/office/DocumentContentReadHandler.java b/reportbuilder/java/org/libreoffice/report/pentaho/parser/office/DocumentContentReadHandler.java index 6d36eb6f9ea5..65a48252e69f 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/parser/office/DocumentContentReadHandler.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/parser/office/DocumentContentReadHandler.java @@ -22,8 +22,7 @@ import org.libreoffice.report.pentaho.model.OfficeDocument; import org.libreoffice.report.pentaho.model.OfficeStylesCollection; import org.libreoffice.report.pentaho.parser.style.OfficeStylesReadHandler; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.util.logging.Logger; import org.jfree.report.JFreeReport; @@ -49,7 +48,7 @@ import org.xml.sax.SAXException; public class DocumentContentReadHandler extends AbstractXmlReadHandler { - private static final Log LOGGER = LogFactory.getLog(DocumentContentReadHandler.class); + private static final Logger LOGGER = Logger.getLogger(DocumentContentReadHandler.class.getName()); private OfficeDocument report; private FontFaceDeclsReadHandler fontFaceReadHandler; private BodyReadHandler bodyReadHandler; @@ -98,12 +97,12 @@ public class DocumentContentReadHandler extends AbstractXmlReadHandler catch (ResourceKeyCreationException e) { // ignore .. - LOGGER.debug("Failed to create resource-key for 'styles.xml'. Ignoring.", e); + LOGGER.config("Failed to create resource-key for 'styles.xml'. Ignoring: " + e); } catch (ResourceException e) { // ignore .. - LOGGER.debug("Failed to parse resource for 'styles.xml'. Ignoring.", e); + LOGGER.config("Failed to parse resource for 'styles.xml'. Ignoring: " + e); } return new OfficeStylesCollection(); @@ -135,12 +134,12 @@ public class DocumentContentReadHandler extends AbstractXmlReadHandler catch (ResourceKeyCreationException e) { // ignore .. - LOGGER.debug("Failed to create resource-key for 'content.xml'. Ignoring."); + LOGGER.config("Failed to create resource-key for 'content.xml'. Ignoring."); } catch (ResourceException e) { // ignore .. - LOGGER.debug("Failed to parse resource for 'content.xml'. Ignoring."); + LOGGER.config("Failed to parse resource for 'content.xml'. Ignoring."); } return new OfficeDocument(); |