From: bruce m. <tr...@us...> - 2004-07-24 00:19:29
|
Update of /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26389/modules/core/src/com/babeldoc/core/config Modified Files: ConfigService.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: ConfigService.java =================================================================== RCS file: /cvsroot/babeldoc/babeldoc/modules/core/src/com/babeldoc/core/config/ConfigService.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ConfigService.java 3 Apr 2004 15:11:33 -0000 1.13 --- ConfigService.java 24 Jul 2004 00:18:50 -0000 1.14 *************** *** 93,96 **** --- 93,99 ---- public class ConfigService implements IConfigService, IConfigChangeNotifier { + + private static LogService log = LogService.getInstance(ConfigService.class.getName()); + /** constant: configuration file */ public static final String CONFIG = "babel.config"; *************** *** 123,127 **** lruNum = Integer.parseInt(lruNumStr); } catch (Exception e) { ! LogService.getInstance().logError(com.babeldoc.core.I18n.get("007001", lruNumStr), e); } --- 126,130 ---- lruNum = Integer.parseInt(lruNumStr); } catch (Exception e) { ! log.logError(com.babeldoc.core.I18n.get("007001", lruNumStr), e); } *************** *** 138,142 **** configService = (IConfigService) Class.forName(config).newInstance(); } catch (Exception e) { ! LogService.getInstance().logError(e); } } --- 141,145 ---- configService = (IConfigService) Class.forName(config).newInstance(); } catch (Exception e) { ! log.logError(e); } } *************** *** 231,235 **** public static void clearCache() { configs.clear(); ! LogService.getInstance().logDebug("Clearing Entire Config Cache"); } --- 234,239 ---- public static void clearCache() { configs.clear(); ! if(log.isDebugEnabled()) ! log.logDebug("Clearing Entire Config Cache"); } *************** *** 242,246 **** public static void clearCache(String name) { configs.remove(name); ! LogService.getInstance().logDebug("Clearing Config Cache for " + name); } --- 246,251 ---- public static void clearCache(String name) { configs.remove(name); ! if(log.isDebugEnabled()) ! log.logDebug("Clearing Config Cache for " + name); } *************** *** 283,287 **** ((IConfigChangeNotifier)configService).addConfigChangeListener(listener); } else { ! throw new com.babeldoc.core.config.ConfigException(I18n.get("005200")); } } --- 288,292 ---- ((IConfigChangeNotifier)configService).addConfigChangeListener(listener); } else { ! throw new ConfigException(I18n.get("005200")); } } *************** *** 298,302 **** ((IConfigChangeNotifier)configService).addConfigChangeListener(listener, config); } else { ! throw new com.babeldoc.core.config.ConfigException(I18n.get("005200")); } } --- 303,307 ---- ((IConfigChangeNotifier)configService).addConfigChangeListener(listener, config); } else { ! throw new ConfigException(I18n.get("005200")); } } *************** *** 313,317 **** ((IConfigChangeNotifier)configService).addConfigChangeListener(listener, configs); } else { ! throw new com.babeldoc.core.config.ConfigException(I18n.get("005200")); } } --- 318,322 ---- ((IConfigChangeNotifier)configService).addConfigChangeListener(listener, configs); } else { ! throw new ConfigException(I18n.get("005200")); } } |