1 16 17 package org.apache.log4j.xml.examples; 18 19 import org.apache.log4j.helpers.LogLog; 20 21 30 public class ReportParserError implements org.xml.sax.ErrorHandler { 31 32 void report(String msg, org.xml.sax.SAXParseException e) { 33 LogLog.error(msg+e.getMessage()+ "\n\tat line="+ e.getLineNumber()+ 34 " col="+e.getColumnNumber()+ " of "+ 35 "SystemId=\""+e.getSystemId()+ 36 "\" PublicID = \""+e.getPublicId()+'\"'); 37 } 38 39 public void warning(org.xml.sax.SAXParseException e) { 40 report("WARNING: ", e); 41 } 42 43 public void error(org.xml.sax.SAXParseException e) { 44 report("ERROR: ", e); 45 } 46 47 public void fatalError(org.xml.sax.SAXParseException e) { 48 report("FATAL: ", e); 49 } 50 } 51 | Popular Tags |