Author: veithen Date: Wed Dec 10 12:11:04 2008 New Revision: 725409 URL: http://svn.apache.org/viewvc?rev=725409&view=rev Log: Dumping stack traces is expensive; if we don't log them, we should not calculate them in the first place!
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/util/OMSerializerUtil.java Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java?rev=725409&r1=725408&r2=725409&view=diff ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java (original) +++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java Wed Dec 10 12:11:04 2008 @@ -54,6 +54,7 @@ public class MTOMXMLStreamWriter implements XMLStreamWriter { private static Log log = LogFactory.getLog(MTOMXMLStreamWriter.class); private static boolean isDebugEnabled = log.isDebugEnabled(); + private static boolean isTraceEnabled = log.isTraceEnabled(); private final static int UNSUPPORTED = -1; private final static int EXCEED_LIMIT = 1; private XMLStreamWriter xmlWriter; @@ -69,7 +70,7 @@ public MTOMXMLStreamWriter(XMLStreamWriter xmlWriter) { this.xmlWriter = xmlWriter; - if (isDebugEnabled) { + if (isTraceEnabled) { log.trace("Call Stack =" + CommonUtils.callStackToString()); } } @@ -88,6 +89,8 @@ if (isDebugEnabled) { log.debug("OutputStream =" + outStream.getClass()); log.debug("OMFormat = " + format.toString()); + } + if (isTraceEnabled) { log.trace("Call Stack =" + CommonUtils.callStackToString()); } this.format = format; Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/util/OMSerializerUtil.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/util/OMSerializerUtil.java?rev=725409&r1=725408&r2=725409&view=diff ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/util/OMSerializerUtil.java (original) +++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/util/OMSerializerUtil.java Wed Dec 10 12:11:04 2008 @@ -615,7 +615,7 @@ */ if (DEBUG_ENABLED) { log.debug("Obtained next prefix:" + prefix); - if (ADV_DEBUG_ENABLED) { + if (ADV_DEBUG_ENABLED && log.isTraceEnabled()) { log.trace(CommonUtils.callStackToString()); } }