velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r579085 - in /velocity/engine/trunk/src/java/org/apache/velocity: runtime/ runtime/directive/ runtime/log/ runtime/parser/node/ runtime/resource/ runtime/resource/loader/ util/introspection/
Date Tue, 25 Sep 2007 06:26:41 GMT
Author: nbubna
Date: Mon Sep 24 23:26:40 2007
New Revision: 579085

URL: http://svn.apache.org/viewvc?rev=579085&view=rev
Log:
adjust logging levels according to http://wiki.apache.org/velocity/LoggingLevel

Modified:
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Macro.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/AvalonLogChute.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/LogManager.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTSetDirective.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java
    velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java
    velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java
    velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/UberspectImpl.java

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java Mon Sep
24 23:26:40 2007
@@ -824,9 +824,9 @@
         for( int i = 0; i < userdirective.length; i++)
         {
             loadDirective(userdirective[i]);
-            if (log.isInfoEnabled())
+            if (log.isDebugEnabled())
             {
-                log.info("Loaded User Directive: " + userdirective[i]);
+                log.debug("Loaded User Directive: " + userdirective[i]);
             }
         }
 
@@ -1335,7 +1335,7 @@
         /* must be initialized before using resourceManager */
         if (!initialized && !initializing)
         {
-            log.info("Velocity not initialized yet. Calling init()...");
+            log.debug("Velocity not initialized yet. Calling init()...");
             init();
         }
 
@@ -1385,7 +1385,7 @@
         /* must be initialized before using resourceManager */
         if (!initialized && !initializing)
         {
-            log.info("Velocity not initialized yet. Calling init()...");
+            log.debug("Velocity not initialized yet. Calling init()...");
             init();
         }
 

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java Mon
Sep 24 23:26:40 2007
@@ -333,7 +333,7 @@
             {
                 setAddMacroPermission(false);
 
-                log.info("allowInline = false : VMs can NOT be defined inline in templates");
+                log.debug("allowInline = false : VMs can NOT be defined inline in templates");
             }
             else
             {
@@ -353,7 +353,7 @@
             {
                 setReplacementPermission(true);
 
-                log.info("allowInlineToOverride = true : VMs " +
+                log.debug("allowInlineToOverride = true : VMs " +
                     "defined inline may replace previous VM definitions");
             }
             else
@@ -376,7 +376,7 @@
 
             if (getTemplateLocalInline())
             {
-                log.info("allowInlineLocal = true : VMs " +
+                log.debug("allowInlineLocal = true : VMs " +
                     "defined inline will be local to their defining template only.");
             }
             else
@@ -394,7 +394,7 @@
 
             if (getAutoload())
             {
-                log.info("autoload on : VM system " +
+                log.debug("autoload on : VM system " +
                      "will automatically reload global library macros");
             }
             else
@@ -448,7 +448,7 @@
                 msg += "sourceTemplate";
             }
             msg += " argument was null";
-            log.warn(msg);
+            log.error(msg);
             return false;
         }
 
@@ -469,13 +469,16 @@
             vmManager.addVM(name, macroBody, argArray, sourceTemplate);
         }
 
-        /*
-         * Report addition of the new Velocimacro.
-         */
-        StringBuffer msg = new StringBuffer("added ");
-        Macro.macroToString(msg, argArray);
-        msg.append(" : source = ").append(sourceTemplate);
-        log.info(msg.toString());
+        if (log.isDebugEnabled())
+        {
+            /*
+             * Report addition of the new Velocimacro.
+             */
+            StringBuffer msg = new StringBuffer("added ");
+            Macro.macroToString(msg, argArray);
+            msg.append(" : source = ").append(sourceTemplate);
+            log.debug(msg.toString());
+        }
 
         return true;
     }
@@ -520,7 +523,7 @@
          */
         if (!addNewAllowed)
         {
-            log.warn("VM addition rejected : "+name+" : inline VMs not allowed.");
+            log.error("VM addition rejected : "+name+" : inline VMs not allowed.");
             return false;
         }
 
@@ -539,7 +542,7 @@
              */
             if (isVelocimacro(name, sourceTemplate) && !replaceAllowed)
             {
-                log.warn("VM addition rejected : "+name+" : inline not allowed to replace
existing VM");
+                log.error("VM addition rejected : "+name+" : inline not allowed to replace
existing VM");
                 return false;
             }
         }

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Macro.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Macro.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Macro.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Macro.java Mon Sep
24 23:26:40 2007
@@ -208,12 +208,12 @@
                                                macroBody.toString(),
                                                argArray, sourceTemplate);
 
-        if (!macroAdded && rs.getLog().isWarnEnabled())
+        if (!macroAdded && rs.getLog().isErrorEnabled())
         {
             StringBuffer msg = new StringBuffer("Failed to add macro: ");
             macroToString(msg, argArray);
             msg.append(" : source = ").append(sourceTemplate);
-            rs.getLog().warn(msg);
+            rs.getLog().error(msg);
         }
     }
 

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/AvalonLogChute.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/AvalonLogChute.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/AvalonLogChute.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/AvalonLogChute.java Mon
Sep 24 23:26:40 2007
@@ -114,7 +114,7 @@
         }
         catch (IOException ioe)
         {
-            rsvc.getLog().warn("Unable to create log file for AvalonLogChute", ioe);
+            rsvc.getLog().error("Unable to create log file for AvalonLogChute", ioe);
             throw new Exception("Error configuring AvalonLogChute : " + ioe);
         }
     }
@@ -131,7 +131,7 @@
         logger = Hierarchy.getDefaultHierarchy().getLoggerFor(rsvc.toString());
         initTarget(file, null);
         // nag the theoretical user
-        log(WARN_ID, "You shouldn't be using the init(String file) method!");
+        log(DEBUG_ID, "You shouldn't be using the init(String file) method!");
     }
 
     /**

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java Mon
Sep 24 23:26:40 2007
@@ -125,7 +125,7 @@
         }
         catch (IOException ioe)
         {
-            rsvc.getLog().warn("Could not create file appender '"+file+'\'', ioe);
+            rsvc.getLog().error("Could not create file appender '"+file+'\'', ioe);
             throw ExceptionUtils.createRuntimeException("Error configuring Log4JLogChute
: ", ioe);
         }
     }

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/LogManager.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/LogManager.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/LogManager.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/log/LogManager.java Mon Sep
24 23:26:40 2007
@@ -90,7 +90,7 @@
             else if (o instanceof LogSystem)
             {
                 // inform the user about the deprecation
-                log.info("LogSystem has been deprecated. Please use a LogChute implementation.");
+                log.debug("LogSystem has been deprecated. Please use a LogChute implementation.");
                 try
                 {
                     // wrap the LogSystem into a chute.
@@ -105,7 +105,7 @@
             }
             else
             {
-                log.warn(o.getClass().getName() + " object set as runtime.log.logsystem is
not a valid log implementation.");
+                log.error(o.getClass().getName() + " object set as runtime.log.logsystem
is not a valid log implementation.");
             }
         }
 
@@ -155,7 +155,7 @@
                     else if (o instanceof LogSystem)
                     {
                         // inform the user about the deprecation
-                        log.info("LogSystem has been deprecated. Please use a LogChute implementation.");
+                        log.debug("LogSystem has been deprecated. Please use a LogChute implementation.");
                         LogChute chute = new LogChuteSystem((LogSystem)o);
                         chute.init(rsvc);
                         return chute;
@@ -191,9 +191,9 @@
                 }
                 catch(Exception e)
                 {
-                    // log init exception at slightly higher priority
-                    log.info("Failed to initialize an instance of " + claz +
-                             " with the current runtime configuration.", e);
+                    // log unexpected init exception at higher priority
+                    log.error("Failed to initialize an instance of " + claz +
+                              " with the current runtime configuration.", e);
                 }
             }
         }

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java
Mon Sep 24 23:26:40 2007
@@ -354,9 +354,9 @@
                 writer.write(nullString);
             }
 
-            if (logOnNull && referenceType != QUIET_REFERENCE && log.isInfoEnabled())
+            if (logOnNull && referenceType != QUIET_REFERENCE && log.isDebugEnabled())
             {
-                log.info("Null reference [template '"
+                log.debug("Null reference [template '"
                          + context.getCurrentTemplateName() + "', line "
                          + this.getLine() + ", column " + this.getColumn()
                          + "] : " + this.literal() + " cannot be resolved.");

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTSetDirective.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTSetDirective.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTSetDirective.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTSetDirective.java
Mon Sep 24 23:26:40 2007
@@ -147,9 +147,9 @@
                 {
                     boolean doit = EventHandlerUtil.shouldLogOnNullSet( rsvc, context, left.literal(),
right.literal() );
 
-                    if (doit && rsvc.getLog().isInfoEnabled())
+                    if (doit && rsvc.getLog().isDebugEnabled())
                     {
-                        rsvc.getLog().info("RHS of #set statement is null. Context will not
be modified. "
+                        rsvc.getLog().debug("RHS of #set statement is null. Context will
not be modified. "
                                       + context.getCurrentTemplateName() + " [line " + getLine()
                                       + ", column " + getColumn() + "]");
                     }

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java
Mon Sep 24 23:26:40 2007
@@ -101,7 +101,7 @@
     {
 	if (isInit)
 	{
-	    log.warn("Re-initialization of ResourceLoader attempted!");
+	    log.error("Re-initialization of ResourceLoader attempted!");
 	    return;
 	}
 	
@@ -110,7 +110,7 @@
         this.rsvc = rsvc;
         log = rsvc.getLog();
 
-        log.debug("Default ResourceManager initializing. (" + this.getClass() + ")");
+        log.trace("Default ResourceManager initializing. (" + this.getClass() + ")");
 
         assembleResourceLoaderInitializers();
 
@@ -233,8 +233,8 @@
 
             if (loaderConfiguration == null)
             {
-                log.warn("ResourceManager : No configuration information for resource loader
named '" +
-                         loaderName + "'. Skipping.");
+                log.error("ResourceManager : No configuration information for resource loader
named '" +
+                          loaderName + "'. Skipping.");
 
                 continue;
             }

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
Mon Sep 24 23:26:40 2007
@@ -172,7 +172,7 @@
         }
         else
         {
-            log.warn("DataSourceResourceLoader not properly initialized. No DataSource was
identified.");
+            log.error("DataSourceResourceLoader not properly initialized. No DataSource was
identified.");
         }
     }
 
@@ -373,7 +373,7 @@
             }
             catch (Exception e)
             {
-                log.warn("DataSourceResourceLoader: problem when closing connection", e);
+                log.error("DataSourceResourceLoader: problem when closing connection", e);
             }
         }
     }
@@ -395,7 +395,7 @@
             }
             catch (Exception e)
             {
-                log.warn("DataSourceResourceLoader: problem when closing result set", e);
+                log.error("DataSourceResourceLoader: problem when closing result set", e);
             }
         }
     }

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java
Mon Sep 24 23:26:40 2007
@@ -103,9 +103,9 @@
 
             if (paths != null && paths.size() > 0)
             {
-                log.info("JarResourceLoader : you are using a deprecated configuration"
-                         + " property for the JarResourceLoader -> '<name>.resource.loader.resource.path'."
-                         + " Please change to the conventional '<name>.resource.loader.path'.");
+                log.debug("JarResourceLoader : you are using a deprecated configuration"
+                          + " property for the JarResourceLoader -> '<name>.resource.loader.resource.path'."
+                          + " Please change to the conventional '<name>.resource.loader.path'.");
             }
         }
 

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java
Mon Sep 24 23:26:40 2007
@@ -241,7 +241,7 @@
             // warn them if they are trying to change the class of the repository
             if (!this.repository.getClass().getName().equals(repoClass))
             {
-                log.warn("Cannot change class of string repository '"+repoName+
+                log.error("Cannot change class of string repository '"+repoName+
                           "' from "+this.repository.getClass().getName()+" to "+repoClass);
             }
 
@@ -249,10 +249,10 @@
             if (encoding != null &&
                 !this.repository.getEncoding().equals(encoding))
             {
-                if (log.isInfoEnabled())
+                if (log.isDebugEnabled())
                 {
-                    log.info("Changing the default encoding of string repository '"+repoName+
-                             "' from "+this.repository.getEncoding()+" to "+encoding);
+                    log.debug("Changing the default encoding of string repository '"+repoName+
+                              "' from "+this.repository.getEncoding()+" to "+encoding);
                 }
                 this.repository.setEncoding(encoding);
             }

Modified: velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java
Mon Sep 24 23:26:40 2007
@@ -170,8 +170,8 @@
         catch (IOException ioe)
         {
             // the file is not reachable at its previous address
-            log.warn("URLResourceLoader: '" + name +
-                     "' is no longer reachable at '" + root + "'", ioe);
+            log.error("URLResourceLoader: '" + name +
+                      "' is no longer reachable at '" + root + "'", ioe);
             return 0;
         }
     }

Modified: velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java
Mon Sep 24 23:26:40 2007
@@ -141,7 +141,7 @@
      */
     public void triggerClear()
     {
-	super.triggerClear();
-        log.info(CACHEDUMP_MSG);
+        super.triggerClear();
+        log.debug(CACHEDUMP_MSG);
     }
 }

Modified: velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/UberspectImpl.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/UberspectImpl.java?rev=579085&r1=579084&r2=579085&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/UberspectImpl.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/UberspectImpl.java
Mon Sep 24 23:26:40 2007
@@ -141,7 +141,7 @@
         }
 
         /*  we have no clue what this is  */
-        log.info("Could not determine type of iterator in #foreach loop at " + i);
+        log.error("Could not determine type of iterator in #foreach loop at " + i);
 
         return null;
     }



Mime
View raw message