Update of /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30233/src/main/java/org/webmacro/resource Modified Files: AbstractTemplateLoader.java BrokerTemplateLoader.java BrokerTemplateProvider.java BrokerTemplateProviderHelper.java CachingProvider.java ClassPathTemplateLoader.java DelegatingTemplateProvider.java FileTemplateLoader.java ReloadDelayDecorator.java ReloadingCacheManager.java ServletContextTemplateLoader.java SimpleCacheManager.java TemplatePathTemplateLoader.java TemplateProvider.java URLTemplate.java URLTemplateProvider.java Log Message: Remove logging Index: URLTemplateProvider.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/URLTemplateProvider.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** URLTemplateProvider.java 25 Mar 2008 22:54:09 -0000 1.21 --- URLTemplateProvider.java 24 Feb 2010 21:02:18 -0000 1.22 *************** *** 31,37 **** import java.util.StringTokenizer; import org.webmacro.Broker; import org.webmacro.InitException; - import org.webmacro.Log; import org.webmacro.NotFoundException; import org.webmacro.ResourceException; --- 31,39 ---- import java.util.StringTokenizer; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; + import org.webmacro.Broker; import org.webmacro.InitException; import org.webmacro.NotFoundException; import org.webmacro.ResourceException; *************** *** 97,100 **** --- 99,103 ---- final public class URLTemplateProvider extends CachingProvider { + static Logger _log = LoggerFactory.getLogger(URLTemplateProvider.class); /** CVS Revision tag. */ *************** *** 164,173 **** /** - * Where we write our log messages - */ - - private Log _log; - - /** * Supports the "template" type. This is a straight replacement for the * default TemplateProvider --- 167,170 ---- *************** *** 194,198 **** super.init(b, config); _broker = b; - _log = b.getLog("resource", "general object loading"); try --- 191,194 ---- Index: URLTemplate.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/URLTemplate.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** URLTemplate.java 20 Mar 2008 12:30:09 -0000 1.12 --- URLTemplate.java 24 Feb 2010 21:02:17 -0000 1.13 *************** *** 34,37 **** --- 34,40 ---- import java.util.Properties; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; + import org.webmacro.Broker; import org.webmacro.TemplateException; *************** *** 48,51 **** --- 51,56 ---- { + static Logger _log = LoggerFactory.getLogger(URLTemplate.class); + /** CVS revision */ public static final String RCS = "@(#) $Id$"; Index: ReloadingCacheManager.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/ReloadingCacheManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ReloadingCacheManager.java 21 Feb 2010 12:26:55 -0000 1.6 --- ReloadingCacheManager.java 24 Feb 2010 21:02:17 -0000 1.7 *************** *** 8,14 **** import java.util.concurrent.TimeUnit; import org.webmacro.Broker; import org.webmacro.InitException; - import org.webmacro.Log; import org.webmacro.ResourceException; import org.webmacro.util.Settings; --- 8,16 ---- import java.util.concurrent.TimeUnit; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; + import org.webmacro.Broker; import org.webmacro.InitException; import org.webmacro.ResourceException; import org.webmacro.util.Settings; *************** *** 24,27 **** --- 26,31 ---- public class ReloadingCacheManager implements CacheManager { + static Logger _log = LoggerFactory.getLogger(ReloadDelayDecorator.class); + private static final String NAME = "ReloadingCacheManager"; *************** *** 37,41 **** private ScheduledExecutorService _clockDaemon; - private Log _log; private abstract class MyCacheElement extends CacheElement implements Cloneable --- 41,44 ---- *************** *** 107,111 **** }); - _log = b.getLog("resource", "Object loading and caching"); _resourceType = resourceType; --- 110,113 ---- *************** *** 176,181 **** { _cache.remove(key); ! if (_log.loggingDebug()) ! _log.debug("cache expired: " + key); } }, --- 178,182 ---- { _cache.remove(key); ! _log.debug("cache expired: " + key); } }, *************** *** 212,217 **** r.setObject(o); _cache.put(query, r); ! if (_log.loggingDebug()) ! _log.debug("cached: " + query + " for " + _cacheDurationMilliseconds); try { --- 213,217 ---- r.setObject(o); _cache.put(query, r); ! _log.debug("cached: " + query + " for " + _cacheDurationMilliseconds); try { *************** *** 254,259 **** if (_cacheDurationMilliseconds >= 0) { ! if (_log.loggingDebug()) ! _log.debug("cached: " + query + " for " + _cacheDurationMilliseconds); scheduleRemoval(query); } --- 254,258 ---- if (_cacheDurationMilliseconds >= 0) { ! _log.debug("cached: " + query + " for " + _cacheDurationMilliseconds); scheduleRemoval(query); } Index: BrokerTemplateProvider.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/BrokerTemplateProvider.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** BrokerTemplateProvider.java 20 Mar 2008 11:42:51 -0000 1.7 --- BrokerTemplateProvider.java 24 Feb 2010 21:02:17 -0000 1.8 *************** *** 23,29 **** package org.webmacro.resource; import org.webmacro.Broker; import org.webmacro.InitException; - import org.webmacro.Log; import org.webmacro.ResourceException; import org.webmacro.util.Settings; --- 23,30 ---- package org.webmacro.resource; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; import org.webmacro.Broker; import org.webmacro.InitException; import org.webmacro.ResourceException; import org.webmacro.util.Settings; *************** *** 43,47 **** private BrokerTemplateProviderHelper _helper; ! private Log _log; public void init (Broker b, Settings config) throws InitException --- 44,48 ---- private BrokerTemplateProviderHelper _helper; ! static Logger _log = LoggerFactory.getLogger(BrokerTemplateProvider.class); public void init (Broker b, Settings config) throws InitException *************** *** 51,55 **** _helper.init(b, config); _helper.setReload(_cacheSupportsReload); - _log = b.getLog("resource", "Object loading and caching"); } --- 52,55 ---- *************** *** 62,67 **** throws ResourceException { ! if (_log.loggingInfo()) ! _log.info("Loading template: " + name); return _helper.load(name, ce); } --- 62,66 ---- throws ResourceException { ! _log.info("Loading template: " + name); return _helper.load(name, ce); } Index: TemplateProvider.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/TemplateProvider.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** TemplateProvider.java 20 Mar 2008 12:48:20 -0000 1.30 --- TemplateProvider.java 24 Feb 2010 21:02:17 -0000 1.31 *************** *** 27,33 **** import java.util.StringTokenizer; import org.webmacro.Broker; import org.webmacro.InitException; - import org.webmacro.Log; import org.webmacro.NotFoundException; import org.webmacro.ResourceException; --- 27,35 ---- import java.util.StringTokenizer; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; + import org.webmacro.Broker; import org.webmacro.InitException; import org.webmacro.NotFoundException; import org.webmacro.ResourceException; *************** *** 43,47 **** * relative to the TemplatePath specified in the configuration. * <p> ! * Ordinarily you would not accses this class directly, but * instead you would call the Broker and it would look up and * use the TemplateProvider for you. --- 45,49 ---- * relative to the TemplatePath specified in the configuration. * <p> ! * Ordinarily you would not access this class directly, but * instead you would call the Broker and it would look up and * use the TemplateProvider for you. *************** *** 52,55 **** --- 54,58 ---- { + static Logger _log = LoggerFactory.getLogger(TemplateProvider.class); // INITIALIZATION *************** *** 58,62 **** private Broker _broker = null; private String _templatePath; - private Log _log; private BrokerTemplateProviderHelper _btpHelper; --- 61,64 ---- *************** *** 111,115 **** super.init(b, config); _broker = b; - _log = b.getLog("resource", "Object loading and caching"); try --- 113,116 ---- *************** *** 158,163 **** Object ret = null; ! if (_log.loggingInfo()) ! _log.info("Loading template: " + name); File tFile = findFileTemplate(name); --- 159,163 ---- Object ret = null; ! _log.info("Loading template: " + name); File tFile = findFileTemplate(name); *************** *** 179,183 **** catch (NullPointerException npe) { ! _log.warning("TemplateProvider: Template not found: " + name, npe); throw new ResourceException("Error fetching template " + name, npe); --- 179,183 ---- catch (NullPointerException npe) { ! _log.warn("TemplateProvider: Template not found: " + name, npe); throw new ResourceException("Error fetching template " + name, npe); *************** *** 186,190 **** { // Parse error ! _log.warning("TemplateProvider: Error occured while parsing " + name, e); throw new InvalidResourceException("Error parsing template " --- 186,190 ---- { // Parse error ! _log.warn("TemplateProvider: Error occured while parsing " + name, e); throw new InvalidResourceException("Error parsing template " *************** *** 193,197 **** catch (Exception e) { ! _log.warning("TemplateProvider: Error occured while fetching " + name, e); throw new ResourceException("Error fetching template " + name, e); --- 193,197 ---- catch (Exception e) { ! _log.warn("TemplateProvider: Error occured while fetching " + name, e); throw new ResourceException("Error fetching template " + name, e); *************** *** 224,229 **** if (_templateDirectory != null) { ! if (_log.loggingDebug()) ! _log.debug("Looking for template in TemplatePath: " + fileName); for (int i = 0; i < _templateDirectory.length; i++) { --- 224,228 ---- if (_templateDirectory != null) { ! _log.debug("Looking for template in TemplatePath: " + fileName); for (int i = 0; i < _templateDirectory.length; i++) { *************** *** 232,237 **** if (tFile.canRead()) { ! if (_log.loggingDebug()) ! _log.debug("TemplateProvider: Found " + fileName + " in " + dir); return tFile; } --- 231,235 ---- if (tFile.canRead()) { ! _log.debug("TemplateProvider: Found " + fileName + " in " + dir); return tFile; } Index: AbstractTemplateLoader.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/AbstractTemplateLoader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbstractTemplateLoader.java 12 Jun 2003 00:47:47 -0000 1.4 --- AbstractTemplateLoader.java 24 Feb 2010 21:02:17 -0000 1.5 *************** *** 22,29 **** package org.webmacro.resource; import org.webmacro.Broker; import org.webmacro.InitException; - import org.webmacro.Log; import org.webmacro.util.Settings; /** --- 22,31 ---- package org.webmacro.resource; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; import org.webmacro.Broker; import org.webmacro.InitException; import org.webmacro.util.Settings; + import org.webmacro.util.WMEval; /** *************** *** 39,44 **** protected Broker broker; ! /** Log to use */ ! protected Log log; /** Helper class for loading templates from files or URLs */ --- 41,46 ---- protected Broker broker; ! /** Logger to use */ ! static Logger _log = LoggerFactory.getLogger(AbstractTemplateLoader.class); /** Helper class for loading templates from files or URLs */ *************** *** 53,57 **** { this.broker = b; - log = b.getLog("resource", "Loading templates"); helper = new TemplateLoaderHelper(); helper.init(b, config); --- 55,58 ---- Index: CachingProvider.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/CachingProvider.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** CachingProvider.java 19 Mar 2008 17:25:18 -0000 1.20 --- CachingProvider.java 24 Feb 2010 21:02:17 -0000 1.21 *************** *** 24,30 **** package org.webmacro.resource; import org.webmacro.Broker; import org.webmacro.InitException; - import org.webmacro.Log; import org.webmacro.Provider; import org.webmacro.ResourceException; --- 24,31 ---- package org.webmacro.resource; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; import org.webmacro.Broker; import org.webmacro.InitException; import org.webmacro.Provider; import org.webmacro.ResourceException; *************** *** 44,49 **** { private CacheManager _cache; - private Log _log; protected boolean _cacheSupportsReload; --- 45,51 ---- { + static Logger _log = LoggerFactory.getLogger(CachingProvider.class); + private CacheManager _cache; protected boolean _cacheSupportsReload; *************** *** 59,64 **** String cacheManager; - _log = b.getLog("resource", "Object loading and caching"); - cacheManager = b.getSetting("CachingProvider." + getType() + ".CacheManager"); --- 61,64 ---- *************** *** 79,83 **** catch (Exception e) { ! _log.warning("Unable to load cache manager " + cacheManager + " for resource type " + getType() + ", using TrivialCacheManager. Reason:\n" + e); --- 79,83 ---- catch (Exception e) { ! _log.warn("Unable to load cache manager " + cacheManager + " for resource type " + getType() + ", using TrivialCacheManager. Reason:\n" + e); Index: FileTemplateLoader.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/FileTemplateLoader.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileTemplateLoader.java 12 Jun 2003 00:47:47 -0000 1.6 --- FileTemplateLoader.java 24 Feb 2010 21:02:17 -0000 1.7 *************** *** 23,26 **** --- 23,28 ---- package org.webmacro.resource; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; import org.webmacro.ResourceException; import org.webmacro.Template; *************** *** 38,41 **** --- 40,45 ---- { + static Logger _log = LoggerFactory.getLogger(FileTemplateLoader.class); + private String path; *************** *** 50,58 **** if (!f.exists()) { ! log.warning("FileTemplateLoader: " + f.getAbsolutePath() + " does not exist."); } else if (!f.isDirectory()) { ! log.warning("FileTemplateLoader: " + f.getAbsolutePath() + " is not a directory."); } } --- 54,62 ---- if (!f.exists()) { ! _log.warn("FileTemplateLoader: " + f.getAbsolutePath() + " does not exist."); } else if (!f.isDirectory()) { ! _log.warn("FileTemplateLoader: " + f.getAbsolutePath() + " is not a directory."); } } *************** *** 67,72 **** if (tFile.isFile() && tFile.canRead()) { ! if (log.loggingDebug()) ! log.debug("FileTemplateProvider: Found template " + tFile.getAbsolutePath()); return helper.load(tFile, ce); } --- 71,75 ---- if (tFile.isFile() && tFile.canRead()) { ! _log.debug("FileTemplateProvider: Found template " + tFile.getAbsolutePath()); return helper.load(tFile, ce); } Index: BrokerTemplateLoader.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/BrokerTemplateLoader.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BrokerTemplateLoader.java 18 Mar 2008 20:08:58 -0000 1.5 --- BrokerTemplateLoader.java 24 Feb 2010 21:02:17 -0000 1.6 *************** *** 22,25 **** --- 22,27 ---- package org.webmacro.resource; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; import org.webmacro.ResourceException; import org.webmacro.Template; *************** *** 34,37 **** --- 36,40 ---- { + static Logger _log = LoggerFactory.getLogger(BrokerTemplateLoader.class); public void setConfig (String config) { *************** *** 39,46 **** if (config != null && config.length() > 0) { ! if (log.loggingWarning()) ! { ! log.warning("BrokerTemplateProvider: Ignoring configuration options " + config); ! } } } --- 42,46 ---- if (config != null && config.length() > 0) { ! _log.warn("BrokerTemplateProvider: Ignoring configuration options " + config); } } *************** *** 49,55 **** { URL url = broker.getTemplate(query); ! if (url != null && log.loggingDebug()) { ! log.debug("BrokerTemplateLoader: Found Template " + url.toString()); } return (url != null) ? helper.load(url, ce) : null; --- 49,55 ---- { URL url = broker.getTemplate(query); ! if (url != null && _log.isDebugEnabled()) { ! _log.debug("BrokerTemplateLoader: Found Template " + url.toString()); } return (url != null) ? helper.load(url, ce) : null; Index: ClassPathTemplateLoader.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/ClassPathTemplateLoader.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ClassPathTemplateLoader.java 12 Jun 2003 00:47:47 -0000 1.7 --- ClassPathTemplateLoader.java 24 Feb 2010 21:02:17 -0000 1.8 *************** *** 22,25 **** --- 22,27 ---- package org.webmacro.resource; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; import org.webmacro.Broker; import org.webmacro.InitException; *************** *** 43,46 **** --- 45,49 ---- { + static Logger _log = LoggerFactory.getLogger(ClassPathTemplateLoader.class); private ClassLoader loader; private String path; *************** *** 57,62 **** if (config.length() > 0 && !config.endsWith("/")) { ! if (log.loggingInfo()) ! log.info("ClassPathTemplateLoader: appending \"/\" to path " + config); config = config.concat("/"); } --- 60,64 ---- if (config.length() > 0 && !config.endsWith("/")) { ! _log.info("ClassPathTemplateLoader: appending \"/\" to path " + config); config = config.concat("/"); } *************** *** 80,86 **** } URL url = loader.getResource(path.concat(query)); ! if (url != null && log.loggingDebug()) { ! log.debug("ClassPathTemplateProvider: Found Template " + url.toString()); } return (url != null) ? helper.load(url, ce) : null; --- 82,88 ---- } URL url = loader.getResource(path.concat(query)); ! if (url != null && _log.isDebugEnabled()) { ! _log.debug("ClassPathTemplateProvider: Found Template " + url.toString()); } return (url != null) ? helper.load(url, ce) : null; Index: ReloadDelayDecorator.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/ReloadDelayDecorator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ReloadDelayDecorator.java 18 Mar 2008 09:33:38 -0000 1.6 --- ReloadDelayDecorator.java 24 Feb 2010 21:02:17 -0000 1.7 *************** *** 22,28 **** package org.webmacro.resource; import org.webmacro.Broker; import org.webmacro.InitException; - import org.webmacro.Log; import org.webmacro.util.Settings; --- 22,29 ---- package org.webmacro.resource; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; import org.webmacro.Broker; import org.webmacro.InitException; import org.webmacro.util.Settings; *************** *** 45,52 **** { ! /** maps protocol types to Long objects */ private Map reloadDelays; private long defaultDelay; - private Log log; public ReloadDelayDecorator () --- 46,54 ---- { ! static Logger _log = LoggerFactory.getLogger(ReloadDelayDecorator.class); ! ! /** maps protocol types to Long objects */ private Map reloadDelays; private long defaultDelay; public ReloadDelayDecorator () *************** *** 81,85 **** }); } - log = b.getLog("resource", "ReloadDelayDecorator"); } --- 83,86 ---- *************** *** 104,119 **** if (delay > 0) { ! if (log.loggingDebug()) ! { ! log.debug("Returning timed reload context with delay " + delay); ! } return new TimedReloadContext(reloadContext, delay); } else { ! if (log.loggingDebug()) ! { ! log.debug("Returning unmodified reload context"); ! } return reloadContext; } --- 105,114 ---- if (delay > 0) { ! _log.debug("Returning timed reload context with delay " + delay); return new TimedReloadContext(reloadContext, delay); } else { ! _log.debug("Returning unmodified reload context"); return reloadContext; } Index: TemplatePathTemplateLoader.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/TemplatePathTemplateLoader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TemplatePathTemplateLoader.java 12 Jun 2003 00:47:47 -0000 1.3 --- TemplatePathTemplateLoader.java 24 Feb 2010 21:02:17 -0000 1.4 *************** *** 23,26 **** --- 23,28 ---- package org.webmacro.resource; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; import org.webmacro.InitException; import org.webmacro.ResourceException; *************** *** 41,44 **** --- 43,48 ---- { + static Logger _log = LoggerFactory.getLogger(TemplatePathTemplateLoader.class); + private TemplateLoader[] loaders; *************** *** 48,52 **** Settings settings = broker.getSettings(); String templatePath = settings.getSetting("TemplatePath", ""); ! log.info("Using legacy template path " + templatePath); if (templatePath.length() != 0) { --- 52,56 ---- Settings settings = broker.getSettings(); String templatePath = settings.getSetting("TemplatePath", ""); ! _log.info("Using legacy template path " + templatePath); if (templatePath.length() != 0) { Index: SimpleCacheManager.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/SimpleCacheManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SimpleCacheManager.java 21 Feb 2010 01:49:49 -0000 1.4 --- SimpleCacheManager.java 24 Feb 2010 21:02:17 -0000 1.5 *************** *** 3,9 **** import java.util.Map; import org.webmacro.Broker; import org.webmacro.InitException; - import org.webmacro.Log; import org.webmacro.ResourceException; import org.webmacro.util.Settings; --- 3,11 ---- import java.util.Map; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; + import org.webmacro.Broker; import org.webmacro.InitException; import org.webmacro.ResourceException; import org.webmacro.util.Settings; *************** *** 19,27 **** public class SimpleCacheManager implements CacheManager { private static final String NAME = "SimpleCacheManager"; private final Map _cache = new ConcurrentHashMap(); private String _resourceType; - private Log _log; public SimpleCacheManager() { --- 21,30 ---- public class SimpleCacheManager implements CacheManager { + static Logger _log = LoggerFactory.getLogger(SimpleCacheManager.class); + private static final String NAME = "SimpleCacheManager"; private final Map _cache = new ConcurrentHashMap(); private String _resourceType; public SimpleCacheManager() { *************** *** 31,35 **** throws InitException { - _log = b.getLog("resource", "Object loading and caching"); _resourceType = resourceType; --- 34,37 ---- Index: ServletContextTemplateLoader.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/ServletContextTemplateLoader.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ServletContextTemplateLoader.java 12 Jun 2003 00:47:47 -0000 1.6 --- ServletContextTemplateLoader.java 24 Feb 2010 21:02:17 -0000 1.7 *************** *** 22,25 **** --- 22,27 ---- package org.webmacro.resource; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; import org.webmacro.Broker; import org.webmacro.InitException; *************** *** 53,56 **** --- 55,60 ---- { + static Logger _log = LoggerFactory.getLogger(ServletContextTemplateLoader.class); + private ServletContext loader; private String path; *************** *** 75,80 **** if (config.length() > 0 && !config.endsWith("/")) { ! if (log.loggingInfo()) ! log.info("ServletContextTemplateLoader: appending \"/\" to path " + config); config = config.concat("/"); } --- 79,83 ---- if (config.length() > 0 && !config.endsWith("/")) { ! _log.info("ServletContextTemplateLoader: appending \"/\" to path " + config); config = config.concat("/"); } *************** *** 83,88 **** if (!config.startsWith("/")) { ! if (log.loggingInfo()) ! log.info("ServletContextTemplateLoader: adding \"/\" at the beginning of path " + config); config = "/".concat(config); } --- 86,90 ---- if (!config.startsWith("/")) { ! _log.info("ServletContextTemplateLoader: adding \"/\" at the beginning of path " + config); config = "/".concat(config); } *************** *** 95,101 **** { URL url = loader.getResource(path.concat(query)); ! if (url != null && log.loggingDebug()) { ! log.debug("ServletContextTemplateProvider: Found Template " + url.toString()); } return (url != null) ? helper.load(url, ce) : null; --- 97,103 ---- { URL url = loader.getResource(path.concat(query)); ! if (url != null && _log.isDebugEnabled()) { ! _log.debug("ServletContextTemplateProvider: Found Template " + url.toString()); } return (url != null) ? helper.load(url, ce) : null; Index: DelegatingTemplateProvider.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/DelegatingTemplateProvider.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DelegatingTemplateProvider.java 18 Mar 2008 09:29:05 -0000 1.9 --- DelegatingTemplateProvider.java 24 Feb 2010 21:02:17 -0000 1.10 *************** *** 29,35 **** import java.util.List; import org.webmacro.Broker; import org.webmacro.InitException; - import org.webmacro.Log; import org.webmacro.NotFoundException; import org.webmacro.ResourceException; --- 29,37 ---- import java.util.List; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; import org.webmacro.Broker; + import org.webmacro.Context; import org.webmacro.InitException; import org.webmacro.NotFoundException; import org.webmacro.ResourceException; *************** *** 73,77 **** { ! private Log log; private TemplateLoaderFactory factory; private TemplateLoader[] templateLoaders; --- 75,80 ---- { ! static Logger _log = LoggerFactory.getLogger(DelegatingTemplateProvider.class); ! private TemplateLoaderFactory factory; private TemplateLoader[] templateLoaders; *************** *** 80,87 **** { super.init(broker, config); - log = broker.getLog("resource", "DelegatingTemplateProvider"); String factoryClass = config.getSetting("TemplateLoaderFactory", ""); ! log.info("DelegatingTemplateProvider: Using TemplateLoaderFactory " + factoryClass); factory = createFactory(factoryClass); --- 83,89 ---- { super.init(broker, config); String factoryClass = config.getSetting("TemplateLoaderFactory", ""); ! _log.info("DelegatingTemplateProvider: Using TemplateLoaderFactory " + factoryClass); factory = createFactory(factoryClass); Index: BrokerTemplateProviderHelper.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/webmacro/src/main/java/org/webmacro/resource/BrokerTemplateProviderHelper.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** BrokerTemplateProviderHelper.java 20 Mar 2008 14:12:58 -0000 1.15 --- BrokerTemplateProviderHelper.java 24 Feb 2010 21:02:17 -0000 1.16 *************** *** 28,34 **** import java.net.URL; import org.webmacro.Broker; import org.webmacro.InitException; - import org.webmacro.Log; import org.webmacro.NotFoundException; import org.webmacro.ResourceException; --- 28,35 ---- import java.net.URL; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; import org.webmacro.Broker; import org.webmacro.InitException; import org.webmacro.NotFoundException; import org.webmacro.ResourceException; *************** *** 53,61 **** { // INITIALIZATION private Broker _broker; //private int _cacheDuration; ! private Log _log; private boolean _cacheSupportsReload = true; private ReloadDelayDecorator reloadDelay; --- 54,65 ---- { + static Logger _log = LoggerFactory.getLogger(BrokerTemplateProviderHelper.class); + // INITIALIZATION private Broker _broker; //private int _cacheDuration; ! ! private boolean _cacheSupportsReload = true; private ReloadDelayDecorator reloadDelay; *************** *** 88,92 **** { _broker = b; - _log = b.getLog("resource", "Object loading and caching"); //_cacheDuration = config.getIntegerSetting("TemplateExpireTime", 0); reloadDelay = new ReloadDelayDecorator(); --- 92,95 ---- *************** *** 145,153 **** catch (NullPointerException npe) { ! _log.warning("BrokerTemplateProvider: Template not found: " + name); } catch (ParseException e) { ! _log.warning("BrokerTemplateProvider: Error occured while parsing " + name, e); throw new InvalidResourceException("Error parsing template " + name, --- 148,156 ---- catch (NullPointerException npe) { ! _log.warn("BrokerTemplateProvider: Template not found: " + name); } catch (ParseException e) { ! _log.warn("BrokerTemplateProvider: Error occured while parsing " + name, e); throw new InvalidResourceException("Error parsing template " + name, *************** *** 156,160 **** catch (IOException e) { ! _log.warning("BrokerTemplateProvider: IOException while parsing " + name, e); throw new InvalidResourceException("Error parsing template " + name, --- 159,163 ---- catch (IOException e) { ! _log.warn("BrokerTemplateProvider: IOException while parsing " + name, e); throw new InvalidResourceException("Error parsing template " + name, *************** *** 163,167 **** catch (Exception e) { ! _log.warning("BrokerTemplateProvider: Error occured while fetching " + name, e); throw new ResourceException("Error parsing template " + name, e); --- 166,170 ---- catch (Exception e) { ! _log.warn("BrokerTemplateProvider: Error occured while fetching " + name, e); throw new ResourceException("Error parsing template " + name, e); *************** *** 195,204 **** final private URL findTemplate (String fileName) { ! if (_log.loggingDebug()) ! _log.debug("Looking for template in class path: " + fileName); URL u = _broker.getTemplate(fileName); if (u != null) ! if (_log.loggingDebug()) ! _log.debug("BrokerTemplateProvider: Found " + fileName + " at " + u.toString()); return u; --- 198,205 ---- final private URL findTemplate (String fileName) { ! _log.debug("Looking for template in class path: " + fileName); URL u = _broker.getTemplate(fileName); if (u != null) ! _log.debug("BrokerTemplateProvider: Found " + fileName + " at " + u.toString()); return u; |