better logging

This commit is contained in:
Doug MacEachern 2006-03-01 22:09:33 +00:00
parent 9965f09f1c
commit 44e27c9d7d
1 changed files with 15 additions and 8 deletions

View File

@ -52,7 +52,7 @@ public class SigarProxyCache
//poor mans logging
private void debug(String msg) {
System.out.println("[DEBUG] SigarProxyCache - " + msg);
SigarLog.getLogger("SigarProxyCache").debug(msg);
}
private static final Class[] VOID_SIGNATURE = new Class[0];
@ -153,15 +153,16 @@ public class SigarProxyCache
cacheVal.expire = this.expire;
}
String argDebug = "";
if (debugEnabled) {
if ((args != null) && (args.length != 0)) {
argDebug = " with args=" +
getDebugArgs(args, argKey);
}
}
if (cacheVal.value != null) {
String argDebug = "";
if (debugEnabled) {
if ((args != null) && (args.length != 0)) {
argDebug = " with args=" +
getDebugArgs(args, argKey);
}
debug("found " + method.getName() +
" in cache" + argDebug);
}
@ -175,6 +176,12 @@ public class SigarProxyCache
cacheVal.value = null;
}
}
else {
if (debugEnabled) {
debug(method.getName() +
" NOT in cache" + argDebug);
}
}
if (cacheVal.value == null) {
try {