From ee58bd0d324680156d6f80662dd5ac4bee8366e5 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sun, 16 Mar 2014 19:46:56 +0000 Subject: [PATCH] Bug 56195: replace System.err with propert logging git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1578147 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/eventusermodel/XSSFSheetXMLHandler.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java index f0f01bb85..0ebb40858 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java @@ -18,6 +18,8 @@ package org.apache.poi.xssf.eventusermodel; import org.apache.poi.ss.usermodel.BuiltinFormats; import org.apache.poi.ss.usermodel.DataFormatter; +import org.apache.poi.util.POILogFactory; +import org.apache.poi.util.POILogger; import org.apache.poi.xssf.model.StylesTable; import org.apache.poi.xssf.usermodel.XSSFCellStyle; import org.apache.poi.xssf.usermodel.XSSFRichTextString; @@ -31,7 +33,9 @@ import org.xml.sax.helpers.DefaultHandler; * row and cell events for it. */ public class XSSFSheetXMLHandler extends DefaultHandler { - /** + private static final POILogger logger = POILogFactory.getLogger(XSSFSheetXMLHandler.class); + + /** * These are the different kinds of cells we support. * We keep track of the current one between * the start and end. @@ -168,7 +172,7 @@ public class XSSFSheetXMLHandler extends DefaultHandler { // TODO Retrieve the shared formula and tweak it to // match the current cell if(formulasNotResults) { - System.err.println("Warning - shared formulas not yet supported!"); + logger.log(POILogger.WARN, "shared formulas not yet supported!"); } else { // It's a shared formula, so we can't get at the formula string yet // However, they don't care about the formula string, so that's ok! @@ -283,7 +287,7 @@ public class XSSFSheetXMLHandler extends DefaultHandler { thisStr = rtss.toString(); } catch (NumberFormatException ex) { - System.err.println("Failed to parse SST index '" + sstIndex + "': " + ex.toString()); + logger.log(POILogger.ERROR, "Failed to parse SST index '" + sstIndex, ex); } break;