From 44e27c9d7d8f34e96c1776636ca86ec781163ba6 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 1 Mar 2006 22:09:33 +0000 Subject: [PATCH] better logging --- .../net/hyperic/sigar/SigarProxyCache.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/bindings/java/src/net/hyperic/sigar/SigarProxyCache.java b/bindings/java/src/net/hyperic/sigar/SigarProxyCache.java index 176a0c26..4fbca648 100644 --- a/bindings/java/src/net/hyperic/sigar/SigarProxyCache.java +++ b/bindings/java/src/net/hyperic/sigar/SigarProxyCache.java @@ -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 {