From: bruce m. <tr...@us...> - 2004-07-24 00:19:29
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26389/modules/core/src/com/babeldoc/core Modified Files: VelocityUtilityContext.java Log Message: Logging cleanups... 1. Created log instance variable instead of calling LogService.getInstance(). 2. All logs to debug check if debug level is set. Index: VelocityUtilityContext.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/VelocityUtilityContext.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** VelocityUtilityContext.java 6 Aug 2003 23:33:06 -0000 1.11 --- VelocityUtilityContext.java 24 Jul 2004 00:18:50 -0000 1.12 *************** *** 111,114 **** --- 111,117 ---- /** static: keep a reference for convenience */ private static VelocityUtilityContext instance; + + /** logging instance */ + private static LogService log = LogService.getInstance(VelocityUtilityContext.class.getName()); /** *************** *** 177,181 **** return new BufferedReader(new InputStreamReader(System.in)).readLine(); } catch (Exception ex) { ! LogService.getInstance().logError(ex); } --- 180,184 ---- return new BufferedReader(new InputStreamReader(System.in)).readLine(); } catch (Exception ex) { ! log.logError(ex); } *************** *** 266,278 **** public void debugObject(Object obj) { if (obj == null) { ! logDebug(I18n.get("005001")); } else { Class classObj = obj.getClass(); ! logDebug(I18n.get("005002") + " " + classObj.toString()); Method[] methods = classObj.getMethods(); for (int i = 0; i < methods.length; ++i) { ! logDebug(I18n.get("005003") + " " + methods[i].getName() + ":" + methods[i].getReturnType()); } --- 269,284 ---- public void debugObject(Object obj) { if (obj == null) { ! if(log.isDebugEnabled()) ! log.logDebug(I18n.get("005001")); } else { Class classObj = obj.getClass(); ! if(log.isDebugEnabled()) ! log.logDebug(I18n.get("005002") + " " + classObj.toString()); Method[] methods = classObj.getMethods(); for (int i = 0; i < methods.length; ++i) { ! if(log.isDebugEnabled()) ! log.logDebug(I18n.get("005003") + " " + methods[i].getName() + ":" + methods[i].getReturnType()); } *************** *** 308,312 **** */ public void logDebug(String line) { ! LogService.getInstance().logDebug(line); } --- 314,318 ---- */ public void logDebug(String line) { ! log.logDebug(line); } *************** *** 317,321 **** */ public void logError(String line) { ! LogService.getInstance().logError(line, null); } --- 323,327 ---- */ public void logError(String line) { ! log.logError(line, null); } *************** *** 326,330 **** */ public void logInfo(String line) { ! LogService.getInstance().logInfo(line); } --- 332,336 ---- */ public void logInfo(String line) { ! log.logInfo(line); } *************** *** 335,339 **** */ public void logWarning(String line) { ! LogService.getInstance().logWarn(line); } --- 341,345 ---- */ public void logWarning(String line) { ! log.logWarn(line); } *************** *** 359,363 **** return new String(messageDigest.digest(value.getBytes())); } catch (NoSuchAlgorithmException e) { ! LogService.getInstance().logError(e); } return ""; --- 365,369 ---- return new String(messageDigest.digest(value.getBytes())); } catch (NoSuchAlgorithmException e) { ! log.logError(e); } return ""; |