[Swift-commit] r3134 - trunk/src/org/griphyn/vdl/mapping
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Sat Oct 10 20:54:15 CDT 2009
Author: hategan
Date: 2009-10-10 20:54:15 -0500 (Sat, 10 Oct 2009)
New Revision: 3134
Modified:
trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
Log:
check for info being enabled before doing expensive string concatenations - for those who want to reduce data logging verbosity
Modified: trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java 2009-10-11 01:50:20 UTC (rev 3133)
+++ trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java 2009-10-11 01:54:15 UTC (rev 3134)
@@ -394,7 +394,9 @@
}
this.closed = true;
notifyListeners();
- logger.info("closed " + this.getIdentifyingString());
+ if (logger.isInfoEnabled()) {
+ logger.info("closed " + this.getIdentifyingString());
+ }
// so because its closed, we can dump the contents
try {
@@ -425,11 +427,13 @@
String identifier = this.getIdentifier();
Path pathFromRoot = this.getPathFromRoot();
if (this.getPathFromRoot() != null) {
- logger.info("ROOTPATH dataset=" + identifier + " path="
- + pathFromRoot);
- if (this.getType().isPrimitive()) {
- logger.info("VALUE dataset=" + identifier + " VALUE="
- + this.toString());
+ if (logger.isInfoEnabled()) {
+ logger.info("ROOTPATH dataset=" + identifier + " path="
+ + pathFromRoot);
+ if (this.getType().isPrimitive()) {
+ logger.info("VALUE dataset=" + identifier + " VALUE="
+ + this.toString());
+ }
}
Mapper m;
@@ -468,12 +472,16 @@
try {
if(filemapped) {
Object path = m.map(pathFromRoot);
- logger.info("FILENAME dataset=" + identifier + " filename="
- + path);
+ if (logger.isInfoEnabled()) {
+ logger.info("FILENAME dataset=" + identifier + " filename="
+ + path);
+ }
}
}
catch (Exception e) {
- logger.info("NOFILENAME dataset=" + identifier);
+ if (logger.isInfoEnabled()) {
+ logger.info("NOFILENAME dataset=" + identifier);
+ }
}
}
}
@@ -483,8 +491,10 @@
while (i.hasNext()) {
Map.Entry e = (Map.Entry) i.next();
AbstractDataNode node = (AbstractDataNode) e.getValue();
- logger.info("CONTAINMENT parent=" + identifier + " child="
- + node.getIdentifier());
+ if (logger.isInfoEnabled()) {
+ logger.info("CONTAINMENT parent=" + identifier + " child="
+ + node.getIdentifier());
+ }
node.logContent();
}
}
More information about the Swift-commit
mailing list