diff options
author | Joakim Erdfelt | 2011-08-24 19:47:55 +0000 |
---|---|---|
committer | Joakim Erdfelt | 2011-08-24 19:47:55 +0000 |
commit | b63e56e8e1e556d72accc155c6527a08fb0cf388 (patch) | |
tree | ac874d11b0ed727abc2ac73c5d1890a534d23c35 | |
parent | 396bb04b863b9cd74ef3fc13cfa8128f5cfd6690 (diff) | |
download | org.eclipse.jetty.project-b63e56e8e1e556d72accc155c6527a08fb0cf388.tar.gz org.eclipse.jetty.project-b63e56e8e1e556d72accc155c6527a08fb0cf388.tar.xz org.eclipse.jetty.project-b63e56e8e1e556d72accc155c6527a08fb0cf388.zip |
293739 - Deprecate static Jetty Log usage in favor of named logs
+ Finished conversion of jetty-xml, jetty-jmx
4 files changed, 122 insertions, 110 deletions
diff --git a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ConnectorServer.java b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ConnectorServer.java index 57106d63ec..40ec6f213b 100644 --- a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ConnectorServer.java +++ b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ConnectorServer.java @@ -29,6 +29,7 @@ import javax.management.remote.JMXServiceURL; import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.thread.ShutdownThread; @@ -38,6 +39,8 @@ import org.eclipse.jetty.util.thread.ShutdownThread; */ public class ConnectorServer extends AbstractLifeCycle { + private static final Logger LOG = Log.getLogger(ConnectorServer.class); + JMXConnectorServer _connectorServer; Registry _registry; @@ -101,7 +104,7 @@ public class ConnectorServer extends AbstractLifeCycle _connectorServer.start(); ShutdownThread.register(0, this); - Log.info("JMX Remote URL: {}", _connectorServer.getAddress().toString()); + LOG.info("JMX Remote URL: {}", _connectorServer.getAddress().toString()); } /* ------------------------------------------------------------ */ @@ -156,7 +159,7 @@ public class ConnectorServer extends AbstractLifeCycle } catch (Exception ex) { - Log.ignore(ex); + LOG.ignore(ex); } } @@ -180,7 +183,7 @@ public class ConnectorServer extends AbstractLifeCycle } catch (Exception ex) { - Log.ignore(ex); + LOG.ignore(ex); } } } diff --git a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java index bea083c722..08797aa726 100644 --- a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java +++ b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/ObjectMBean.java @@ -51,6 +51,7 @@ import org.eclipse.jetty.util.LazyList; import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; /* ------------------------------------------------------------ */ /** ObjectMBean. @@ -67,6 +68,8 @@ import org.eclipse.jetty.util.log.Log; */ public class ObjectMBean implements DynamicMBean { + private static final Logger LOG = Log.getLogger(ObjectMBean.class); + private static Class[] OBJ_ARG = new Class[]{Object.class}; protected Object _managed; @@ -117,8 +120,8 @@ public class ObjectMBean implements DynamicMBean try { Class mClass = (Object.class.equals(oClass))?oClass=ObjectMBean.class:Loader.loadClass(oClass,mName,true); - if (Log.isDebugEnabled()) - Log.debug("mbeanFor " + o + " mClass=" + mClass); + if (LOG.isDebugEnabled()) + LOG.debug("mbeanFor " + o + " mClass=" + mClass); try { @@ -127,7 +130,7 @@ public class ObjectMBean implements DynamicMBean } catch(Exception e) { - Log.ignore(e); + LOG.ignore(e); if (ModelMBean.class.isAssignableFrom(mClass)) { mbean=mClass.newInstance(); @@ -135,8 +138,8 @@ public class ObjectMBean implements DynamicMBean } } - if (Log.isDebugEnabled()) - Log.debug("mbeanFor " + o + " is " + mbean); + if (LOG.isDebugEnabled()) + LOG.debug("mbeanFor " + o + " is " + mbean); return mbean; } catch (ClassNotFoundException e) @@ -146,18 +149,18 @@ public class ObjectMBean implements DynamicMBean // message after the class name when running in Apache Felix, // as well as before the class name when running in JBoss. if (e.getMessage().contains(mName)) - Log.ignore(e); + LOG.ignore(e); else - Log.warn(e); + LOG.warn(e); } catch (Error e) { - Log.warn(e); + LOG.warn(e); mbean = null; } catch (Exception e) { - Log.warn(e); + LOG.warn(e); mbean = null; } @@ -166,7 +169,7 @@ public class ObjectMBean implements DynamicMBean } catch (Exception e) { - Log.ignore(e); + LOG.ignore(e); } return null; } @@ -243,7 +246,7 @@ public class ObjectMBean implements DynamicMBean try { - Log.debug(rName); + LOG.debug(rName); ResourceBundle bundle = Loader.getResourceBundle(o_class, rName,true,Locale.getDefault()); @@ -285,7 +288,7 @@ public class ObjectMBean implements DynamicMBean } catch(MissingResourceException e) { - Log.ignore(e); + LOG.ignore(e); } } @@ -299,7 +302,7 @@ public class ObjectMBean implements DynamicMBean } catch(RuntimeException e) { - Log.warn(e); + LOG.warn(e); throw e; } return _info; @@ -352,12 +355,12 @@ public class ObjectMBean implements DynamicMBean } catch (IllegalAccessException e) { - Log.warn(Log.EXCEPTION, e); + LOG.warn(Log.EXCEPTION, e); throw new AttributeNotFoundException(e.toString()); } catch (InvocationTargetException e) { - Log.warn(Log.EXCEPTION, e); + LOG.warn(Log.EXCEPTION, e); throw new ReflectionException(new Exception(e.getCause())); } } @@ -374,7 +377,7 @@ public class ObjectMBean implements DynamicMBean } catch (Exception e) { - Log.warn(Log.EXCEPTION, e); + LOG.warn(Log.EXCEPTION, e); } } return results; @@ -386,8 +389,8 @@ public class ObjectMBean implements DynamicMBean if (attr == null) return; - if (Log.isDebugEnabled()) - Log.debug("setAttribute " + _managed + ":" +attr.getName() + "=" + attr.getValue()); + if (LOG.isDebugEnabled()) + LOG.debug("setAttribute " + _managed + ":" +attr.getName() + "=" + attr.getValue()); Method setter = (Method) _setters.get(attr.getName()); if (setter == null) throw new AttributeNotFoundException(attr.getName()); @@ -420,12 +423,12 @@ public class ObjectMBean implements DynamicMBean } catch (IllegalAccessException e) { - Log.warn(Log.EXCEPTION, e); + LOG.warn(Log.EXCEPTION, e); throw new AttributeNotFoundException(e.toString()); } catch (InvocationTargetException e) { - Log.warn(Log.EXCEPTION, e); + LOG.warn(Log.EXCEPTION, e); throw new ReflectionException(new Exception(e.getCause())); } } @@ -433,7 +436,7 @@ public class ObjectMBean implements DynamicMBean /* ------------------------------------------------------------ */ public AttributeList setAttributes(AttributeList attrs) { - Log.debug("setAttributes"); + LOG.debug("setAttributes"); AttributeList results = new AttributeList(attrs.size()); Iterator iter = attrs.iterator(); @@ -447,7 +450,7 @@ public class ObjectMBean implements DynamicMBean } catch (Exception e) { - Log.warn(Log.EXCEPTION, e); + LOG.warn(Log.EXCEPTION, e); } } return results; @@ -456,8 +459,8 @@ public class ObjectMBean implements DynamicMBean /* ------------------------------------------------------------ */ public Object invoke(String name, Object[] params, String[] signature) throws MBeanException, ReflectionException { - if (Log.isDebugEnabled()) - Log.debug("invoke " + name); + if (LOG.isDebugEnabled()) + LOG.debug("invoke " + name); String methodKey = name + "("; if (signature != null) @@ -480,17 +483,17 @@ public class ObjectMBean implements DynamicMBean } catch (NoSuchMethodException e) { - Log.warn(Log.EXCEPTION, e); + LOG.warn(Log.EXCEPTION, e); throw new ReflectionException(e); } catch (IllegalAccessException e) { - Log.warn(Log.EXCEPTION, e); + LOG.warn(Log.EXCEPTION, e); throw new MBeanException(e); } catch (InvocationTargetException e) { - Log.warn(Log.EXCEPTION, e); + LOG.warn(Log.EXCEPTION, e); throw new ReflectionException(new Exception(e.getCause())); } finally @@ -561,8 +564,8 @@ public class ObjectMBean implements DynamicMBean String uName = name.substring(0, 1).toUpperCase() + name.substring(1); Class oClass = onMBean ? this.getClass() : _managed.getClass(); - if (Log.isDebugEnabled()) - Log.debug("defineAttribute "+name+" "+onMBean+":"+writable+":"+oClass+":"+description); + if (LOG.isDebugEnabled()) + LOG.debug("defineAttribute "+name+" "+onMBean+":"+writable+":"+oClass+":"+description); Class type = null; Method getter = null; @@ -578,13 +581,13 @@ public class ObjectMBean implements DynamicMBean { if (getter != null) { - Log.warn("Multiple mbean getters for attr " + name+ " in "+oClass); + LOG.warn("Multiple mbean getters for attr " + name+ " in "+oClass); continue; } getter = methods[m]; if (type != null && !type.equals(methods[m].getReturnType())) { - Log.warn("Type conflict for mbean attr " + name+ " in "+oClass); + LOG.warn("Type conflict for mbean attr " + name+ " in "+oClass); continue; } type = methods[m].getReturnType(); @@ -595,13 +598,13 @@ public class ObjectMBean implements DynamicMBean { if (getter != null) { - Log.warn("Multiple mbean getters for attr " + name+ " in "+oClass); + LOG.warn("Multiple mbean getters for attr " + name+ " in "+oClass); continue; } getter = methods[m]; if (type != null && !type.equals(methods[m].getReturnType())) { - Log.warn("Type conflict for mbean attr " + name+ " in "+oClass); + LOG.warn("Type conflict for mbean attr " + name+ " in "+oClass); continue; } type = methods[m].getReturnType(); @@ -612,13 +615,13 @@ public class ObjectMBean implements DynamicMBean { if (setter != null) { - Log.warn("Multiple setters for mbean attr " + name+ " in "+oClass); + LOG.warn("Multiple setters for mbean attr " + name+ " in "+oClass); continue; } setter = methods[m]; if (type != null && !type.equals(methods[m].getParameterTypes()[0])) { - Log.warn("Type conflict for mbean attr " + name+ " in "+oClass); + LOG.warn("Type conflict for mbean attr " + name+ " in "+oClass); continue; } type = methods[m].getParameterTypes()[0]; @@ -629,20 +632,20 @@ public class ObjectMBean implements DynamicMBean { if (type==null) { - Log.warn("No mbean type for " + name+" on "+_managed.getClass()); + LOG.warn("No mbean type for " + name+" on "+_managed.getClass()); return null; } if (type.isPrimitive() && !type.isArray()) { - Log.warn("Cannot convert mbean primative " + name); + LOG.warn("Cannot convert mbean primative " + name); return null; } } if (getter == null && setter == null) { - Log.warn("No mbean getter or setters found for " + name+ " in "+oClass); + LOG.warn("No mbean getter or setters found for " + name+ " in "+oClass); return null; } @@ -669,7 +672,7 @@ public class ObjectMBean implements DynamicMBean } catch (Exception e) { - Log.warn(name+": "+metaData, e); + LOG.warn(name+": "+metaData, e); throw new IllegalArgumentException(e.toString()); } } @@ -699,8 +702,8 @@ public class ObjectMBean implements DynamicMBean boolean onMBean= i==0 && ("MBean".equalsIgnoreCase(tokens[0])||"MMBean".equalsIgnoreCase(tokens[0])); boolean convert= i==0 && ("MObject".equalsIgnoreCase(tokens[0])||"MMBean".equalsIgnoreCase(tokens[0])); - if (Log.isDebugEnabled()) - Log.debug("defineOperation "+signature+" "+onMBean+":"+impact_name+":"+description); + if (LOG.isDebugEnabled()) + LOG.debug("defineOperation "+signature+" "+onMBean+":"+impact_name+":"+description); Class oClass = onMBean ? this.getClass() : _managed.getClass(); @@ -717,7 +720,7 @@ public class ObjectMBean implements DynamicMBean else if (impact_name.equals("ACTION_INFO")) impact=MBeanOperationInfo.ACTION_INFO; else - Log.warn("Unknown impact '"+impact_name+"' for "+signature); + LOG.warn("Unknown impact '"+impact_name+"' for "+signature); // split the signature @@ -746,8 +749,8 @@ public class ObjectMBean implements DynamicMBean { String param_desc = bundle.getString(signature + "[" + i + "]"); parts=param_desc.split(" *: *",2); - if (Log.isDebugEnabled()) - Log.debug(parts[0]+": "+parts[1]); + if (LOG.isDebugEnabled()) + LOG.debug(parts[0]+": "+parts[1]); pInfo[i] = new MBeanParameterInfo(parts[0].trim(), args[i], parts[1].trim()); } @@ -762,7 +765,7 @@ public class ObjectMBean implements DynamicMBean } catch (Exception e) { - Log.warn("Operation '"+signature+"'", e); + LOG.warn("Operation '"+signature+"'", e); throw new IllegalArgumentException(e.toString()); } diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java index 6ba272943a..f70138b819 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java @@ -44,6 +44,7 @@ import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.component.LifeCycle; import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -60,6 +61,8 @@ import org.xml.sax.SAXException; */ public class XmlConfiguration { + private static final Logger LOG = Log.getLogger(XmlConfiguration.class); + private static final Class<?>[] __primitives = { Boolean.TYPE, Character.TYPE, Byte.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE, Float.TYPE, Double.TYPE, Void.TYPE }; @@ -81,7 +84,7 @@ public class XmlConfiguration } catch(Exception e) { - Log.ignore(e); + LOG.ignore(e); } finally { @@ -124,8 +127,8 @@ public class XmlConfiguration } catch (ClassNotFoundException e) { - Log.warn(e.toString()); - Log.debug(e); + LOG.warn(e.toString()); + LOG.debug(e); } } @@ -209,7 +212,7 @@ public class XmlConfiguration } catch (Exception e) { - Log.warn(e); + LOG.warn(e); } if (_processor!=null) break; @@ -386,7 +389,7 @@ public class XmlConfiguration } catch (Exception e) { - Log.warn("Config error at " + node,e.toString()); + LOG.warn("Config error at " + node,e.toString()); throw e; } } @@ -419,8 +422,8 @@ public class XmlConfiguration if (value != null) vClass[0] = value.getClass(); - if (Log.isDebugEnabled()) - Log.debug("XML " + (obj != null?obj.toString():oClass.getName()) + "." + name + "(" + value + ")"); + if (LOG.isDebugEnabled()) + LOG.debug("XML " + (obj != null?obj.toString():oClass.getName()) + "." + name + "(" + value + ")"); // Try for trivial match try @@ -431,15 +434,15 @@ public class XmlConfiguration } catch (IllegalArgumentException e) { - Log.ignore(e); + LOG.ignore(e); } catch (IllegalAccessException e) { - Log.ignore(e); + LOG.ignore(e); } catch (NoSuchMethodException e) { - Log.ignore(e); + LOG.ignore(e); } // Try for native match @@ -453,19 +456,19 @@ public class XmlConfiguration } catch (NoSuchFieldException e) { - Log.ignore(e); + LOG.ignore(e); } catch (IllegalArgumentException e) { - Log.ignore(e); + LOG.ignore(e); } catch (IllegalAccessException e) { - Log.ignore(e); + LOG.ignore(e); } catch (NoSuchMethodException e) { - Log.ignore(e); + LOG.ignore(e); } // Try a field @@ -480,7 +483,7 @@ public class XmlConfiguration } catch (NoSuchFieldException e) { - Log.ignore(e); + LOG.ignore(e); } // Search for a match by trying all the set methods @@ -502,11 +505,11 @@ public class XmlConfiguration } catch (IllegalArgumentException e) { - Log.ignore(e); + LOG.ignore(e); } catch (IllegalAccessException e) { - Log.ignore(e); + LOG.ignore(e); } // Can we convert to a collection @@ -524,11 +527,11 @@ public class XmlConfiguration } catch (IllegalArgumentException e) { - Log.ignore(e); + LOG.ignore(e); } catch (IllegalAccessException e) { - Log.ignore(e); + LOG.ignore(e); } } } @@ -558,15 +561,15 @@ public class XmlConfiguration } catch (NoSuchMethodException e) { - Log.ignore(e); + LOG.ignore(e); } catch (IllegalAccessException e) { - Log.ignore(e); + LOG.ignore(e); } catch (InstantiationException e) { - Log.ignore(e); + LOG.ignore(e); } } @@ -589,8 +592,8 @@ public class XmlConfiguration String name = node.getAttribute("name"); Object value = value(obj,node); map.put(name,value); - if (Log.isDebugEnabled()) - Log.debug("XML " + obj + ".put(" + name + "," + value + ")"); + if (LOG.isDebugEnabled()) + LOG.debug("XML " + obj + ".put(" + name + "," + value + ")"); } /* ------------------------------------------------------------ */ @@ -609,8 +612,8 @@ public class XmlConfiguration String name = node.getAttribute("name"); String id = node.getAttribute("id"); - if (Log.isDebugEnabled()) - Log.debug("XML get " + name); + if (LOG.isDebugEnabled()) + LOG.debug("XML get " + name); try { @@ -681,8 +684,8 @@ public class XmlConfiguration } String method = node.getAttribute("name"); - if (Log.isDebugEnabled()) - Log.debug("XML call " + method); + if (LOG.isDebugEnabled()) + LOG.debug("XML call " + method); try { @@ -735,8 +738,8 @@ public class XmlConfiguration arg[j++] = value(obj,(XmlParser.Node)o); } - if (Log.isDebugEnabled()) - Log.debug("XML new " + oClass); + if (LOG.isDebugEnabled()) + LOG.debug("XML new " + oClass); // Lets just try all constructors for now Constructor[] constructors = oClass.getConstructors(); @@ -754,15 +757,15 @@ public class XmlConfiguration } catch (IllegalAccessException e) { - Log.ignore(e); + LOG.ignore(e); } catch (InstantiationException e) { - Log.ignore(e); + LOG.ignore(e); } catch (IllegalArgumentException e) { - Log.ignore(e); + LOG.ignore(e); } if (called) { @@ -1086,7 +1089,7 @@ public class XmlConfiguration return System.getProperty(name,defaultValue); } - Log.warn("Unknown value tag: " + node,new Throwable()); + LOG.warn("Unknown value tag: " + node,new Throwable()); return null; } } @@ -1131,19 +1134,19 @@ public class XmlConfiguration { Class<?> config = XmlConfiguration.class.getClassLoader().loadClass("org.eclipse.jetty.start.Config"); properties = (Properties)config.getMethod("getProperties").invoke(null); - Log.debug("org.eclipse.jetty.start.Config properties = {}",properties); + LOG.debug("org.eclipse.jetty.start.Config properties = {}",properties); } catch (NoClassDefFoundError e) { - Log.ignore(e); + LOG.ignore(e); } catch (ClassNotFoundException e) { - Log.ignore(e); + LOG.ignore(e); } catch (Exception e) { - Log.warn(e); + LOG.warn(e); } // If no start.config properties, use clean slate @@ -1205,7 +1208,7 @@ public class XmlConfiguration } catch (Exception e) { - Log.debug(Log.EXCEPTION,e); + LOG.debug(Log.EXCEPTION,e); exception.set(e); } return null; diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java index 105bf4bc9f..5307925a13 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java @@ -31,6 +31,7 @@ import javax.xml.parsers.SAXParserFactory; import org.eclipse.jetty.util.LazyList; import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; @@ -52,6 +53,8 @@ import org.xml.sax.helpers.DefaultHandler; */ public class XmlParser { + private static final Logger LOG = Log.getLogger(XmlParser.class); + private Map<String,URL> _redirectMap = new HashMap<String,URL>(); private SAXParser _parser; private Map<String,ContentHandler> _observerMap; @@ -99,9 +102,9 @@ public class XmlParser catch (Exception e) { if (validating) - Log.warn("Schema validation may not be supported: ", e); + LOG.warn("Schema validation may not be supported: ", e); else - Log.ignore(e); + LOG.ignore(e); } _parser.getXMLReader().setFeature("http://xml.org/sax/features/validation", validating); @@ -114,12 +117,12 @@ public class XmlParser } catch (Exception e) { - Log.warn(e.getMessage()); + LOG.warn(e.getMessage()); } } catch (Exception e) { - Log.warn(Log.EXCEPTION, e); + LOG.warn(Log.EXCEPTION, e); throw new Error(e.toString()); } } @@ -191,8 +194,8 @@ public class XmlParser reader.setContentHandler(handler); reader.setErrorHandler(handler); reader.setEntityResolver(handler); - if (Log.isDebugEnabled()) - Log.debug("parsing: sid=" + source.getSystemId() + ",pid=" + source.getPublicId()); + if (LOG.isDebugEnabled()) + LOG.debug("parsing: sid=" + source.getSystemId() + ",pid=" + source.getPublicId()); _parser.parse(source, handler); if (handler._error != null) throw handler._error; @@ -207,8 +210,8 @@ public class XmlParser */ public synchronized Node parse(String url) throws IOException, SAXException { - if (Log.isDebugEnabled()) - Log.debug("parse: " + url); + if (LOG.isDebugEnabled()) + LOG.debug("parse: " + url); return parse(new InputSource(url)); } @@ -218,8 +221,8 @@ public class XmlParser */ public synchronized Node parse(File file) throws IOException, SAXException { - if (Log.isDebugEnabled()) - Log.debug("parse: " + file); + if (LOG.isDebugEnabled()) + LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); } @@ -374,8 +377,8 @@ public class XmlParser /* ------------------------------------------------------------ */ public void warning(SAXParseException ex) { - Log.debug(Log.EXCEPTION, ex); - Log.warn("WARNING@" + getLocationString(ex) + " : " + ex.toString()); + LOG.debug(Log.EXCEPTION, ex); + LOG.warn("WARNING@" + getLocationString(ex) + " : " + ex.toString()); } /* ------------------------------------------------------------ */ @@ -384,16 +387,16 @@ public class XmlParser // Save error and continue to report other errors if (_error == null) _error = ex; - Log.debug(Log.EXCEPTION, ex); - Log.warn("ERROR@" + getLocationString(ex) + " : " + ex.toString()); + LOG.debug(Log.EXCEPTION, ex); + LOG.warn("ERROR@" + getLocationString(ex) + " : " + ex.toString()); } /* ------------------------------------------------------------ */ public void fatalError(SAXParseException ex) throws SAXException { _error = ex; - Log.debug(Log.EXCEPTION, ex); - Log.warn("FATAL@" + getLocationString(ex) + " : " + ex.toString()); + LOG.debug(Log.EXCEPTION, ex); + LOG.warn("FATAL@" + getLocationString(ex) + " : " + ex.toString()); throw ex; } @@ -406,8 +409,8 @@ public class XmlParser /* ------------------------------------------------------------ */ public InputSource resolveEntity(String pid, String sid) { - if (Log.isDebugEnabled()) - Log.debug("resolveEntity(" + pid + ", " + sid + ")"); + if (LOG.isDebugEnabled()) + LOG.debug("resolveEntity(" + pid + ", " + sid + ")"); if (sid!=null && sid.endsWith(".dtd")) _dtd=sid; @@ -423,8 +426,8 @@ public class XmlParser if (dtd.lastIndexOf('/') >= 0) dtd = dtd.substring(dtd.lastIndexOf('/') + 1); - if (Log.isDebugEnabled()) - Log.debug("Can't exact match entity in redirect map, trying " + dtd); + if (LOG.isDebugEnabled()) + LOG.debug("Can't exact match entity in redirect map, trying " + dtd); entity = (URL) _redirectMap.get(dtd); } @@ -433,15 +436,15 @@ public class XmlParser try { InputStream in = entity.openStream(); - if (Log.isDebugEnabled()) - Log.debug("Redirected entity " + sid + " --> " + entity); + if (LOG.isDebugEnabled()) + LOG.debug("Redirected entity " + sid + " --> " + entity); InputSource is = new InputSource(in); is.setSystemId(sid); return is; } catch (IOException e) { - Log.ignore(e); + LOG.ignore(e); } } return null; |