Author: toad
Date: 2007-08-11 17:24:42 +0000 (Sat, 11 Aug 2007)
New Revision: 14618
Modified:
trunk/freenet/src/freenet/io/comm/IOStatisticCollector.java
Log:
Cache shouldLog
Modified: trunk/freenet/src/freenet/io/comm/IOStatisticCollector.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/IOStatisticCollector.java 2007-08-11
17:17:03 UTC (rev 14617)
+++ trunk/freenet/src/freenet/io/comm/IOStatisticCollector.java 2007-08-11
17:24:42 UTC (rev 14618)
@@ -16,6 +16,7 @@
private long lastrotate;
private static IOStatisticCollector _currentSC;
+ private static boolean logDEBUG;
private long totalbytesin;
private long totalbytesout;
private final LinkedHashMap targets;
@@ -28,6 +29,7 @@
// This should only happen once
//SNMPAgent.create();
//SNMPStarter.initialize();
+ logDEBUG = Logger.shouldLog(Logger.DEBUG, this);
}
private static IOStatisticCollector getSC() {
@@ -59,8 +61,8 @@
synchronized(this) {
totalbytesout += (outbytes>0)?outbytes:0;
totalbytesin += (inbytes>0)?inbytes:0;
- if(Logger.shouldLog(Logger.MINOR,
IOStatisticCollector.class))
- Logger.minor(IOStatisticCollector.class,
"Add("+key+ ',' +inbytes+ ',' +outbytes+" -> "+totalbytesin+" :
"+totalbytesout);
+ if(logDEBUG)
+ Logger.debug(IOStatisticCollector.class,
"Add("+key+ ',' +inbytes+ ',' +outbytes+" -> "+totalbytesin+" :
"+totalbytesout);
}
}