From: Seth P. <se...@us...> - 2004-06-04 17:50:52
|
Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml/finder/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7308/com/sun/xacml/finder/impl Modified Files: FilePolicyModule.java Log Message: Introduced some new, basic logging Index: FilePolicyModule.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/finder/impl/FilePolicyModule.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FilePolicyModule.java 12 May 2004 21:23:44 -0000 1.5 --- FilePolicyModule.java 4 Jun 2004 17:50:40 -0000 1.6 *************** *** 58,61 **** --- 58,64 ---- import java.util.Set; + import java.util.logging.Level; + import java.util.logging.Logger; + import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; *************** *** 120,123 **** --- 123,130 ---- private Set policies; + // the logger we'll use for all messages + private static final Logger logger = + Logger.getLogger(FilePolicyModule.class.getName()); + /** * Constructor which retrieves the schema file to validate policies against *************** *** 285,294 **** } else { // this isn't a root type that we know how to handle ! System.err.println("unknown root document type: " + name); } } catch (Exception e) { ! System.err.println("error reading policy: " + filename); ! System.err.println("error message: " + e.getMessage()); } --- 292,302 ---- } else { // this isn't a root type that we know how to handle ! throw new Exception("Unknown root document type: " + name); } } catch (Exception e) { ! if (logger.isLoggable(Level.WARNING)) ! logger.log(Level.WARNING, "Error reading policy from file " + ! filename, e); } *************** *** 353,357 **** */ public void warning(SAXParseException exception) throws SAXException { ! System.out.println("Warning on line " + exception.getLineNumber() + ": " + exception.getMessage()); } --- 361,366 ---- */ public void warning(SAXParseException exception) throws SAXException { ! if (logger.isLoggable(Level.WARNING)) ! logger.warning("Warning on line " + exception.getLineNumber() + ": " + exception.getMessage()); } *************** *** 365,372 **** */ public void error(SAXParseException exception) throws SAXException { ! System.out.println("Error on line " + exception.getLineNumber() + ": " + exception.getMessage() + " ... " + ! "Policy will not be availabe"); ! throw new SAXException("error parsing policy"); } --- 374,382 ---- */ public void error(SAXParseException exception) throws SAXException { ! if (logger.isLoggable(Level.WARNING)) ! logger.warning("Error on line " + exception.getLineNumber() + ": " + exception.getMessage() + " ... " + ! "Policy will not be available"); ! throw new SAXException("error parsing policy"); } *************** *** 380,386 **** */ public void fatalError(SAXParseException exception) throws SAXException { ! System.out.println("FatalError on line " + exception.getLineNumber() + ": " + exception.getMessage() + " ... " + ! "Policy will not be availabe"); throw new SAXException("fatal error parsing policy"); --- 390,397 ---- */ public void fatalError(SAXParseException exception) throws SAXException { ! if (logger.isLoggable(Level.WARNING)) ! logger.warning("Fatal error on line " + exception.getLineNumber() + ": " + exception.getMessage() + " ... " + ! "Policy will not be available"); throw new SAXException("fatal error parsing policy"); |