From velocity-dev-returnalyssa14@example.net Sat Oct 01 01:41:16 2005 Return-Path: <velocity-dev-returnalyssa14@example.net> Delivered-To: alyssa14@example.net Received: (qmail 30523 invoked from network); 1 Oct 2005 01:41:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Oct 2005 01:41:12 -0000 Received: (qmail 85947 invoked by uid 500); 1 Oct 2005 01:41:10 -0000 Delivered-To: alyssa14@example.net Received: (qmail 85934 invoked by uid 500); 1 Oct 2005 01:41:09 -0000 Mailing-List: contact alyssa14@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:alyssa14@example.net> List-Help: <mailto:alyssa14@example.net> List-Post: <mailto:alyssa14@example.net> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <alyssa14@example.net> Delivered-To: mailing list alyssa14@example.net Received: (qmail 85923 invoked by uid 500); 1 Oct 2005 01:41:09 -0000 Received: (qmail 85920 invoked by uid 99); 1 Oct 2005 01:41:09 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2005 18:41:09 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id 0F426E0 for <alyssa14@example.net>; Sat, 1 Oct 2005 03:40:48 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki <alyssa14@example.net> To: alyssa14@example.net Date: Sat, 01 Oct 2005 01:40:47 -0000 Message-ID: <alyssa14@example.net> Subject: [Jakarta-velocity Wiki] Update of "PoweredByVelocity" by ChrisBurkey X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dear Wiki user, You have subscribed to a wiki page or wiki category on "Jakarta-velocity Wiki" for change notification. The following page has been changed by ChrisBurkey: http://wiki.apache.org/jakarta-velocity/PoweredByVelocity The comment on the change is: Added OpenEdit to the web framework area and our showcase to the site area ------------------------------------------------------------------------------ Velocity powered websites. ||<tablewidth="100%">'''URL'''||'''Description'''||<25%>'''Created By'''|| + ||[http://www.openedit.org/showcase/]|| 10 nice looking Velocity powered web sites that are all built and maintained with the free OpenEdit content management system.Each page is dynamic, fast loading and search engine friendly.|| [http://www.openedit.org]|| ||[http://www.jhsystems.net www.jhsystems.net]|| Notice: Velocity mailing list search provided! J&H Systems is specialized in search engine, Web database development using java open source technologies. Our website and Web database products are all powered by Velocity ||[http://www.jhsystems.net]|| ||[http://www.interfacexpress.com www.interfacexpress.com]||InterfacExpress is a web based system that allows realtors to search listings online. Technologies used include Jetty web server and Velocity template engine.||[http://www.realtyserver.com RealtyServer]|| ||[http://www.everyboat.com www.everyboat.com]||Every Boat uses Velocity templates to generate static caches of classified ads resulting in fast ad retrieval with no database connections required.||[http://www.everyboat.com Every Boat Classifieds]|| @@ -98, +99 @@ ||<30%tablewidth="100%">'''Name'''||'''Description'''|| ||[http://jakarta.apache.org/turbine/ Jakarta Turbine]||One of the early servlet-based web frameworks, and currently in version 2.1, Turbine is a framework that allows experienced Java developers to quickly build secure web applications. While Turbines primary templating technology is Velocity, it also supports JSP, WebMacro, FreeMarker, ECS and others.|| ||[http://www.springframework.org Spring Framework]||Spring is a layered Java/J2EE application framework, based on code published in Expert One-on-One J2EE Design and Development by Rod Johnson (Wrox, 2002). Specifically, it is a complete, lightweight container providing centralized, automated configuration and wiring of your application objects. It includes a flexible MVC web application framework which is highly configurable via strategy interfaces, and accommodates multiple view technologies like JSP, Velocity, Tiles, iText, and POI.|| + ||[http://www.openedit.org OpenEdit]|| OpenEdit is a platform used by web design firms for creating and maintaining web sites. It includes content management, eCommerce and blog editing tools and is built from the ground up with Velocity. Uses Spring for Java objects and actions and requires no database. || ||[http://www.jcorporate.com/expresso.html Expresso]||Expresso is a powerful, enterprise-strength web application development framework. Expresso extends Struts for developing database-driven web applications and adds capabilities for security, robust object-relational mapping, and many other services commonly required in web application development. Expresso can use Velocity for the view tier, as well as several other technologies.|| ||[http://click.sourceforge.net Click]||Click is a J2EE web application framework created for commercial Java developers. Highlights include: very easy to learn; event based programming model; high performance.|| ||[http://www.melati.org Melati]||Melati is a tool for building Java-programmed websites backed by a database.|| --------------------------------------------------------------------- To unsubscribe, e-mail: alyssa14@example.net For additional commands, e-mail: alyssa14@example.net From velocity-dev-returnalyssa14@example.net Sat Oct 01 01:47:14 2005 Return-Path: <velocity-dev-returnalyssa14@example.net> Delivered-To: alyssa14@example.net Received: (qmail 31119 invoked from network); 1 Oct 2005 01:47:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Oct 2005 01:47:10 -0000 Received: (qmail 88963 invoked by uid 500); 1 Oct 2005 01:47:03 -0000 Delivered-To: alyssa14@example.net Received: (qmail 88765 invoked by uid 500); 1 Oct 2005 01:47:02 -0000 Mailing-List: contact alyssa14@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:alyssa14@example.net> List-Help: <mailto:alyssa14@example.net> List-Post: <mailto:alyssa14@example.net> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <alyssa14@example.net> Delivered-To: mailing list alyssa14@example.net Received: (qmail 88754 invoked by uid 500); 1 Oct 2005 01:47:02 -0000 Received: (qmail 88751 invoked by uid 99); 1 Oct 2005 01:47:02 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2005 18:47:01 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id 3E9AAE0 for <alyssa14@example.net>; Sat, 1 Oct 2005 03:46:40 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki <alyssa14@example.net> To: alyssa14@example.net Date: Sat, 01 Oct 2005 01:46:40 -0000 Message-ID: <alyssa14@example.net> Subject: [Jakarta-velocity Wiki] Update of "OpenEdit" by ChrisBurkey X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dear Wiki user, You have subscribed to a wiki page or wiki category on "Jakarta-velocity Wiki" for change notification. The following page has been changed by ChrisBurkey: http://wiki.apache.org/jakarta-velocity/OpenEdit The comment on the change is: detail page on OpenEdit New page: OpenEdit is a collection of open source applications powered by Velocity. OpenEdit is used by web design shops to create and manage web sites. Please see: http://www.openedit.org/docs/opensource.html to download. * OpenEdit core [http://dev.openedit.org/anthill/projects/openedit/oesite.war] - Provides the layout engine, Velocity, Spring framework (all in under 1.5 megs) * openedit-editor [http://dev.openedit.org/anthill/projects/openedit-editor/ROOT.war] - Online editing, usermanager, filemanager, version control and notification tools * openedit-cart [http://dev.openedit.org/anthill/projects/openedit-cart/ROOT.war] - Catalog manager, shopping cart and storefront tools * openedit-blog [http://dev.openedit.org/anthill/projects/openedit-blog/ROOT.war] - Blog administration and posting engine * openedit-intranet [http://dev.openedit.org/anthill/projects/openedit-intranet/intranet.war] - Group calendar, in-out board, online editing of content, password protection * openedit-search [http://dev.openedit.org/anthill/projects/openedit-search/search.war] - Nutch/Lucene based web crawling and searching * openedit-archive [http://dev.openedit.org/anthill/projects/openedit-archive/ROOT.war] - Image search and catalog system. Based on openedit-cart. Creates thumbnails, does image conversions, advanced search, download cart contents as zip, tree based interface. openedit-acme - This contains a crazy web demo [http://dev.openedit.org/anthill/projects/openedit-acme/ROOT.war] that integrates every plugin we have into one web application. We are looking for people to join us on our mailing lists to discuss more. --------------------------------------------------------------------- To unsubscribe, e-mail: alyssa14@example.net For additional commands, e-mail: alyssa14@example.net From velocity-dev-returnalyssa14@example.net Sat Oct 01 01:47:46 2005 Return-Path: <velocity-dev-returnalyssa14@example.net> Delivered-To: alyssa14@example.net Received: (qmail 31244 invoked from network); 1 Oct 2005 01:47:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Oct 2005 01:47:44 -0000 Received: (qmail 89244 invoked by uid 500); 1 Oct 2005 01:47:43 -0000 Delivered-To: alyssa14@example.net Received: (qmail 89227 invoked by uid 500); 1 Oct 2005 01:47:43 -0000 Mailing-List: contact alyssa14@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:alyssa14@example.net> List-Help: <mailto:alyssa14@example.net> List-Post: <mailto:alyssa14@example.net> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <alyssa14@example.net> Delivered-To: mailing list alyssa14@example.net Received: (qmail 89216 invoked by uid 99); 1 Oct 2005 01:47:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2005 18:47:43 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO forio.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2005 18:47:48 -0700 Received: (qmail 21761 invoked from network); 1 Oct 2005 01:47:20 -0000 Received: from c-69-181-76-33.hsd1.ca.comcast.net (HELO Apollo) (83.161.120.155) by broadcast.forio.com with RC4-MD5 encrypted SMTP; 1 Oct 2005 01:47:20 -0000 Message-ID: <008901c5c62a$0ee60990$9600a8c0@Apollo> From: "Will Glass-Husain" <alyssa14@example.net> To: "Velocity Developers List" <alyssa14@example.net>, "Tim Colson" <alyssa14@example.net> References: <alyssa14@example.net> Subject: Re: VELTOOLS - Jira project created Date: Fri, 30 Sep 2005 18:46:31 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Thanks, Tim! Really appreciate all your efforts. The transition to JIRA was a great idea. Glad too we have you to share your JIRA expertise with all of us. WILL ----- Original Message ----- From: "Tim Colson" <alyssa14@example.net> To: <alyssa14@example.net> Sent: Friday, September 30, 2005 1:05 PM Subject: VELTOOLS - Jira project created Well -- if you hadn't noticed the 60 or so emails... the VELTOOLS jira project has been created and I moved the issues pertaining to tools over there. (oddly, when fixing an empty component setting, jira also wiped out the affects and fix versions on the open issues.) I also removed the "TOOLS x.x" version labels from the VELOCITY project and the TOOLS component. So now the roadmap for both projects is fairly clean. Speaking of the AFFECTS and FIX version -- some times I see they are set to be the same, which technically shouldn't really happen. The "FIX" version should always be a higher version that is not "affected". For bugs that regress -- then the AFFECTS gains another version and FIX gets pushed out further. Cheers, Timo --------------------------------------------------------------------- To unsubscribe, e-mail: alyssa14@example.net For additional commands, e-mail: alyssa14@example.net --------------------------------------------------------------------- To unsubscribe, e-mail: alyssa14@example.net For additional commands, e-mail: alyssa14@example.net From velocity-dev-returnalyssa14@example.net Sat Oct 01 03:34:00 2005 Return-Path: <velocity-dev-returnalyssa14@example.net> Delivered-To: alyssa14@example.net Received: (qmail 67255 invoked from network); 1 Oct 2005 03:34:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Oct 2005 03:34:00 -0000 Received: (qmail 44155 invoked by uid 500); 1 Oct 2005 03:33:59 -0000 Delivered-To: alyssa14@example.net Received: (qmail 44130 invoked by uid 500); 1 Oct 2005 03:33:58 -0000 Mailing-List: contact alyssa14@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:alyssa14@example.net> List-Help: <mailto:alyssa14@example.net> List-Post: <mailto:alyssa14@example.net> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <alyssa14@example.net> Delivered-To: mailing list alyssa14@example.net Received: (qmail 44119 invoked by uid 500); 1 Oct 2005 03:33:58 -0000 Received: (qmail 44116 invoked by uid 99); 1 Oct 2005 03:33:58 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO ajax.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2005 20:33:56 -0700 Received: from ajax.apache.org (ajax.apache.org [83.161.120.155]) by ajax.apache.org (Postfix) with ESMTP id 3DDF0DF for <alyssa14@example.net>; Sat, 1 Oct 2005 05:33:35 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki <alyssa14@example.net> To: alyssa14@example.net Date: Sat, 01 Oct 2005 03:33:35 -0000 Message-ID: <alyssa14@example.net> Subject: [Jakarta-velocity Wiki] Trivial Update of "PoweredByVelocity" by MichaelHeuer X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dear Wiki user, You have subscribed to a wiki page or wiki category on "Jakarta-velocity Wiki" for change notification. The following page has been changed by MichaelHeuer: http://wiki.apache.org/jakarta-velocity/PoweredByVelocity The comment on the change is: added dishevelled.org codegen link ------------------------------------------------------------------------------ ||[http://sourceforge.net/projects/veloedit/ VeloEdit]||VeloEdit provides an [http://www.eclipse.org/ Eclipse] plugin for Velocity templates.|| ||[http://virtualschool.edu/ale/ Action Learning Environment (ALE)]||ALE is an open source project for building experimental learning environments.|| ||[http://www.binamics.com/hibernatesynch/ Hibernate Synchronizer]||Hibernate Synchronizer is an Eclipse plugin to be used with Hibernate to keep your Java business objects automatically synchronized with your Hibernate mapping files.|| + ||[http://www.dishevelled.org/codegen codegen]||dishevelled.org codegen is a java source code generation suite based on Velocity templates that generates source code in several different styles.|| ||[http://www.dbsight.net/ DBSight]||DBSight is an J2EE RAD tool to create search like "Search Engine" style, or "Product Catalog" style, on any databases. Only simple SQL knowledge is needed. The search results are based on Velocity, which can be modified via web browser by the user to customize the look and feel. [http://search.dbsight.com/ Online Demo] is available.|| --------------------------------------------------------------------- To unsubscribe, e-mail: alyssa14@example.net For additional commands, e-mail: alyssa14@example.net From velocity-dev-returnalyssa14@example.net Sat Oct 01 04:38:08 2005 Return-Path: <velocity-dev-returnalyssa14@example.net> Delivered-To: alyssa14@example.net Received: (qmail 81382 invoked from network); 1 Oct 2005 04:38:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Oct 2005 04:38:08 -0000 Received: (qmail 73468 invoked by uid 500); 1 Oct 2005 04:38:06 -0000 Delivered-To: alyssa14@example.net Received: (qmail 73430 invoked by uid 500); 1 Oct 2005 04:38:05 -0000 Mailing-List: contact alyssa14@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:alyssa14@example.net> List-Help: <mailto:alyssa14@example.net> List-Post: <mailto:alyssa14@example.net> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <alyssa14@example.net> Delivered-To: mailing list alyssa14@example.net Received: (qmail 73418 invoked by uid 500); 1 Oct 2005 04:38:04 -0000 Received: (qmail 73415 invoked by uid 99); 1 Oct 2005 04:38:04 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 30 Sep 2005 21:38:03 -0700 Received: (qmail 81333 invoked by uid 65534); 1 Oct 2005 04:37:43 -0000 Message-ID: <alyssa14@example.net> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r292918 [3/3] - in /jakarta/velocity/core/trunk: ./ build/lib/ src/java/org/apache/velocity/ src/java/org/apache/velocity/app/event/ src/java/org/apache/velocity/app/event/implement/ src/java/org/apache/velocity/runtime/ src/java/org/apache... Date: Sat, 01 Oct 2005 04:37:29 -0000 To: alyssa14@example.net From: alyssa14@example.net X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java Fri Sep 30 21:36:58 2005 @@ -80,7 +80,7 @@ */ public void init( ExtendedProperties configuration) { - rsvc.info("JarResourceLoader : initialization starting."); + log.info("JarResourceLoader : initialization starting."); // rest of Velocity engine still use legacy Vector // and Hashtable classes. Classes are implicitly @@ -97,34 +97,34 @@ if (paths != null && paths.size() > 0) { - rsvc.warn("JarResourceLoader : you are using a deprecated configuration" + log.warn("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'."); } } - rsvc.info("JarResourceLoader # of paths : " + paths.size() ); + log.info("JarResourceLoader # of paths : " + paths.size() ); for ( int i=0; i<paths.size(); i++ ) { loadJar( (String)paths.get(i) ); } - rsvc.info("JarResourceLoader : initialization complete."); + log.info("JarResourceLoader : initialization complete."); } private void loadJar( String path ) { - rsvc.info("JarResourceLoader : trying to load: " + path); + log.info("JarResourceLoader : trying to load: " + path); // Check path information if ( path == null ) { - rsvc.error("JarResourceLoader : can not load JAR - JAR path is null"); + log.error("JarResourceLoader : can not load JAR - JAR path is null"); } if ( !path.startsWith("jar:") ) { - rsvc.error("JarResourceLoader : JAR path must start with jar: -> " + + log.error("JarResourceLoader : JAR path must start with jar: -> " + "see java.net.JarURLConnection for information"); } if ( !path.endsWith("!/") ) @@ -193,7 +193,7 @@ " contains .. and may be trying to access " + "content outside of template root. Rejected."; - rsvc.error( "JarResourceLoader : " + msg ); + log.error( "JarResourceLoader : " + msg ); throw new ResourceNotFoundException ( msg ); } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java Fri Sep 30 21:36:58 2005 @@ -19,7 +19,7 @@ import java.io.InputStream; import org.apache.velocity.runtime.RuntimeServices; - +import org.apache.velocity.runtime.log.Log; import org.apache.velocity.runtime.resource.Resource; import org.apache.velocity.runtime.resource.ResourceCacheImpl; @@ -56,6 +56,7 @@ protected String className = null; protected RuntimeServices rsvc = null; + protected Log log = null; /** * This initialization is used by all resource @@ -65,6 +66,7 @@ public void commonInit( RuntimeServices rs, ExtendedProperties configuration) { this.rsvc = rs; + this.log = rsvc.getLog(); /* * these two properties are not required for all loaders. @@ -81,8 +83,7 @@ catch (Exception e) { isCachingOn = false; - rs.error(e.getMessage() + ": Using default of '" + isCachingOn - + '\''); + log.error("Exception using default of '" + isCachingOn + '\'', e); } try { @@ -91,8 +92,8 @@ catch (Exception e) { modificationCheckInterval = 0; - rs.error(e.getMessage() + ": Using default of '" + - modificationCheckInterval + '\''); + log.error("Exception using default of '" + + modificationCheckInterval + '\'', e); } /* @@ -105,8 +106,7 @@ } catch (Exception e) { - rs.error(e.getMessage() + ": Using default of '" + className - + '\''); + log.error("Exception using default of '" + className + '\'', e); } } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoaderFactory.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoaderFactory.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoaderFactory.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoaderFactory.java Fri Sep 30 21:36:58 2005 @@ -41,17 +41,17 @@ { loader = (ResourceLoader) ClassUtils.getNewInstance( loaderClassName ); - rs.info("Resource Loader Instantiated: " + - loader.getClass().getName()); + rs.getLog().info("Resource Loader Instantiated: " + + loader.getClass().getName()); return loader; } catch( Exception e) { - rs.error("Problem instantiating the template loader.\n" + + rs.getLog().error("Problem instantiating the template loader.\n" + "Look at your properties file and make sure the\n" + "name of the template loader is correct. Here is the\n" + - "error: " + StringUtils.stackTrace(e)); + "error:", e); throw new Exception("Problem initializing template loader: " + loaderClassName + "\nError is: " + StringUtils.stackTrace(e)); Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java Fri Sep 30 21:36:58 2005 @@ -17,7 +17,8 @@ */ import java.lang.reflect.Method; - +import org.apache.velocity.runtime.log.Log; +import org.apache.velocity.runtime.log.RuntimeLoggerLog; import org.apache.velocity.runtime.RuntimeLogger; /** @@ -59,16 +60,21 @@ "Introspector : detected classloader change. Dumping cache."; /** - * our engine runtime services + * The Log we use */ - private RuntimeLogger rlog = null; + private Log log = null; + + public Introspector(Log log) + { + this.log = log; + } /** - * Recieves our RuntimeServices object + * @deprecated RuntimeLogger is deprecated. Use Introspector(Log log). */ public Introspector(RuntimeLogger logger) { - this.rlog = logger; + this(new RuntimeLoggerLog(logger)); } /** @@ -115,7 +121,7 @@ msg = msg + ") for class " + c; - rlog.error( msg ); + log.error( msg ); } return null; @@ -128,6 +134,6 @@ protected void clearCache() { super.clearCache(); - rlog.info( CACHEDUMP_MSG ); + log.info( CACHEDUMP_MSG ); } } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/UberspectImpl.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/UberspectImpl.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/UberspectImpl.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/UberspectImpl.java Fri Sep 30 21:36:58 2005 @@ -22,7 +22,8 @@ import java.util.Enumeration; import java.util.Iterator; import java.util.Map; - +import org.apache.velocity.runtime.log.Log; +import org.apache.velocity.runtime.log.RuntimeLoggerLog; import org.apache.velocity.runtime.RuntimeLogger; import org.apache.velocity.runtime.parser.node.AbstractExecutor; import org.apache.velocity.runtime.parser.node.BooleanPropertyExecutor; @@ -43,7 +44,7 @@ /** * Our runtime logger. */ - private RuntimeLogger rlog; + private Log log; /** * the default Velocity introspector @@ -65,10 +66,20 @@ * else besides init() as to get the logger. Makes the pull * model appealing... */ + public void setLog(Log log) + { + this.log = log; + introspector = new Introspector(log); + } + + /** + * @deprecated Use setLog(Log log) instead. + */ public void setRuntimeLogger(RuntimeLogger runtimeLogger) { - rlog = runtimeLogger; - introspector = new Introspector(rlog); + // in the off chance anyone still uses this method + // directly, use this hack to keep it working + setLog(new RuntimeLoggerLog(runtimeLogger)); } /** @@ -95,7 +106,7 @@ } else if (obj instanceof Iterator) { - rlog.debug("The iterative object in the #foreach() loop at " + + log.debug("The iterative object in the #foreach() loop at " + i + " is of type java.util.Iterator. Because " + "it is not resettable, if used in more than once it " + "may lead to unexpected results."); @@ -104,7 +115,7 @@ } else if (obj instanceof Enumeration) { - rlog.debug("The iterative object in the #foreach() loop at " + + log.debug("The iterative object in the #foreach() loop at " + i + " is of type java.util.Enumeration. Because " + "it is not resettable, if used in more than once it " + "may lead to unexpected results."); @@ -113,7 +124,7 @@ } /* we have no clue what this is */ - rlog.warn("Could not determine type of iterator in " + + log.warn("Could not determine type of iterator in " + "#foreach loop at " + i); return null; @@ -148,7 +159,7 @@ * (also getfoo() ) */ - executor = new PropertyExecutor(rlog,introspector, claz, identifier); + executor = new PropertyExecutor(log,introspector, claz, identifier); /* * if that didn't work, look for get("foo") @@ -156,7 +167,7 @@ if (!executor.isAlive()) { - executor = new GetExecutor(rlog, introspector, claz, identifier); + executor = new GetExecutor(log, introspector, claz, identifier); } /* @@ -165,7 +176,7 @@ if (!executor.isAlive()) { - executor = new BooleanPropertyExecutor(rlog, introspector, claz, + executor = new BooleanPropertyExecutor(log, introspector, claz, identifier); } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/UberspectLoggable.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/UberspectLoggable.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/UberspectLoggable.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/UberspectLoggable.java Fri Sep 30 21:36:58 2005 @@ -1,7 +1,7 @@ package org.apache.velocity.util.introspection; /* - * Copyright 2002-2004 The Apache Software Foundation. + * Copyright 2002-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ */ import org.apache.velocity.runtime.RuntimeLogger; +import org.apache.velocity.runtime.log.Log; /** * Marker interface to let an uberspector indicate it can and wants to @@ -24,15 +25,22 @@ * * Thanks to Paulo for the suggestion * + * @author <a href="mailto:alyssa14@example.net">Nathan Bubna</a> * @author <a href="mailto:alyssa14@example.net">Geir Magnusson Jr.</a> * @version $Id$ * */ public interface UberspectLoggable { + + /** + * Sets the logger. This will be called before any calls to the + * uberspector + */ + public void setLog(Log log); + /** - * Sets the logger. This will be called before any calls to the - * uberspector + * @deprecated Use setLog(Log log) instead. */ public void setRuntimeLogger(RuntimeLogger logger); } Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ClassloaderChangeTestCase.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ClassloaderChangeTestCase.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ClassloaderChangeTestCase.java (original) +++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ClassloaderChangeTestCase.java Fri Sep 30 21:36:58 2005 @@ -27,7 +27,7 @@ import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.runtime.RuntimeServices; -import org.apache.velocity.runtime.log.LogSystem; +import org.apache.velocity.runtime.log.LogChute; import org.apache.velocity.util.introspection.Introspector; /** @@ -36,7 +36,7 @@ * @author <a href="mailto:alyssa14@example.net">Geir Magnusson Jr.</a> * @version $Id$ */ -public class ClassloaderChangeTestCase extends TestCase implements LogSystem +public class ClassloaderChangeTestCase extends TestCase implements LogChute { private VelocityEngine ve = null; private boolean sawCacheDump = false; @@ -55,10 +55,6 @@ public void setUp() throws Exception { - /* - * use an alternative logger. Set it up here and pass it in. - */ - ve = new VelocityEngine(); ve.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM, this ); ve.init(); @@ -142,12 +138,27 @@ * method to catch Velocity log messages. When we * see the introspector dump message, then set the flag */ - public void logVelocityMessage(int level, String message) + public void log(int level, String message) { if (message.equals( Introspector.CACHEDUMP_MSG) ) { sawCacheDump = true; } + } + + /** + * method to catch Velocity log messages. When we + * see the introspector dump message, then set the flag + */ + public void log(int level, String message, Throwable t) + { + // ignore the Throwable for this test + log(level, message); + } + + public boolean isLevelEnabled(int level) + { + return true; } } Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/EventHandlingTestCase.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/EventHandlingTestCase.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/EventHandlingTestCase.java (original) +++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/EventHandlingTestCase.java Fri Sep 30 21:36:58 2005 @@ -35,7 +35,7 @@ import org.apache.velocity.exception.MethodInvocationException; import org.apache.velocity.runtime.RuntimeConstants; import org.apache.velocity.runtime.RuntimeServices; -import org.apache.velocity.runtime.log.LogSystem; +import org.apache.velocity.runtime.log.LogChute; /** * Tests event handling for all event handlers except IncludeEventHandler. This is tested @@ -46,7 +46,7 @@ */ public class EventHandlingTestCase extends TestCase - implements LogSystem + implements LogChute { private static String NO_REFERENCE_VALUE = "<no reference value>"; private static String REFERENCE_VALUE = "<reference value>"; @@ -284,7 +284,7 @@ } /** - * Required by LogSystem + * Required by LogChute */ public void init( RuntimeServices rs ) { @@ -292,11 +292,21 @@ } /** - * handler for LogSystem interface + * handler for LogChute interface */ - public void logVelocityMessage(int level, String message) + public void log(int level, String message) { setLogString(message); + } + + public void log(int level, String message, Throwable t) + { + setLogString(message); + } + + public boolean isLevelEnabled(int level) + { + return true; } public static void clearLogString() Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ExternalLoggerTestCase.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ExternalLoggerTestCase.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ExternalLoggerTestCase.java (original) +++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ExternalLoggerTestCase.java Fri Sep 30 21:36:58 2005 @@ -22,7 +22,7 @@ import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.runtime.RuntimeServices; -import org.apache.velocity.runtime.log.LogSystem; +import org.apache.velocity.runtime.log.LogChute; /** * Tests if we can hand Velocity an arbitrary class for logging. @@ -30,7 +30,7 @@ * @author <a href="mailto:alyssa14@example.net">Geir Magnusson Jr.</a> * @version $Id$ */ -public class ExternalLoggerTestCase extends TestCase implements LogSystem +public class ExternalLoggerTestCase extends TestCase implements LogChute { private String logString = null; @@ -87,7 +87,7 @@ } } - public void logVelocityMessage(int level, String message) + public void log(int level, String message) { String out = ""; @@ -96,16 +96,19 @@ */ switch( level ) { - case LogSystem.DEBUG_ID : + case LogChute.DEBUG_ID : out = VelocityEngine.DEBUG_PREFIX; break; - case LogSystem.INFO_ID : + case LogChute.INFO_ID : out = VelocityEngine.INFO_PREFIX; break; - case LogSystem.WARN_ID : + case LogChute.TRACE_ID : + out = VelocityEngine.TRACE_PREFIX; + break; + case LogChute.WARN_ID : out = VelocityEngine.WARN_PREFIX; break; - case LogSystem.ERROR_ID : + case LogChute.ERROR_ID : out = VelocityEngine.ERROR_PREFIX; break; default : @@ -114,5 +117,16 @@ } logString = out + message; + } + + public void log(int level, String message, Throwable t) + { + // ignore the Throwable, we're not testing this method here + log(level, message); + } + + public boolean isLevelEnabled(int level) + { + return true; } } Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/FilteredEventHandlingTestCase.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/FilteredEventHandlingTestCase.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/FilteredEventHandlingTestCase.java (original) +++ jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/FilteredEventHandlingTestCase.java Fri Sep 30 21:36:58 2005 @@ -32,7 +32,7 @@ import org.apache.velocity.exception.MethodInvocationException; import org.apache.velocity.runtime.RuntimeConstants; import org.apache.velocity.runtime.RuntimeServices; -import org.apache.velocity.runtime.log.LogSystem; +import org.apache.velocity.runtime.log.LogChute; /** * Tests event handling for all event handlers when multiple event handlers are @@ -41,7 +41,7 @@ * @author <a href="mailto:alyssa14@example.net">Geir Magnusson Jr.</a> * @version $Id$ */ -public class FilteredEventHandlingTestCase extends BaseTestCase implements LogSystem +public class FilteredEventHandlingTestCase extends BaseTestCase implements LogChute { /** @@ -88,7 +88,7 @@ /** - * Required by LogSystem + * Required by LogChute */ public void init( RuntimeServices rs ) { @@ -247,11 +247,21 @@ /** - * handler for LogSystem interface + * handler for LogChute interface */ - public void logVelocityMessage(int level, String message) + public void log(int level, String message) { logString = message; + } + + public void log(int level, String message, Throwable t) + { + logString = message; + } + + public boolean isLevelEnabled(int level) + { + return true; } } --------------------------------------------------------------------- To unsubscribe, e-mail: alyssa14@example.net For additional commands, e-mail: alyssa14@example.net From velocity-dev-returnalyssa14@example.net Sat Oct 01 04:38:08 2005 Return-Path: <velocity-dev-returnalyssa14@example.net> Delivered-To: alyssa14@example.net Received: (qmail 81398 invoked from network); 1 Oct 2005 04:38:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Oct 2005 04:38:08 -0000 Received: (qmail 73692 invoked by uid 500); 1 Oct 2005 04:38:06 -0000 Delivered-To: alyssa14@example.net Received: (qmail 73542 invoked by uid 500); 1 Oct 2005 04:38:06 -0000 Mailing-List: contact alyssa14@example.net; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:alyssa14@example.net> List-Help: <mailto:alyssa14@example.net> List-Post: <mailto:alyssa14@example.net> List-Id: "Velocity Developers List" <velocity-dev.jakarta.apache.org> Reply-To: "Velocity Developers List" <alyssa14@example.net> Delivered-To: mailing list alyssa14@example.net Received: (qmail 73437 invoked by uid 500); 1 Oct 2005 04:38:05 -0000 Received: (qmail 73431 invoked by uid 99); 1 Oct 2005 04:38:05 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO minotaur.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 30 Sep 2005 21:38:02 -0700 Received: (qmail 81327 invoked by uid 65534); 1 Oct 2005 04:37:42 -0000 Message-ID: <alyssa14@example.net> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r292918 [1/3] - in /jakarta/velocity/core/trunk: ./ build/lib/ src/java/org/apache/velocity/ src/java/org/apache/velocity/app/event/ src/java/org/apache/velocity/app/event/implement/ src/java/org/apache/velocity/runtime/ src/java/org/apache... Date: Sat, 01 Oct 2005 04:37:29 -0000 To: alyssa14@example.net From: alyssa14@example.net X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: wglass Date: Fri Sep 30 21:36:58 2005 New Revision: 292918 URL: http://svn.apache.org/viewcvs?rev=292918&view=rev Log: Comprehensive logging update patch from Nathan Bubna. Introduces LogChute interface, deprecates LogSystem. See VELOCITY-403 for patch details. Note: now requires JDK 1.4 to compile and Log4j 1.2.12. Solves issues from * VELOCITY-78 * VELOCITY-157 * VELOCITY-159 * VELOCITY-193 * VELOCITY-403 Added: jakarta/velocity/core/trunk/build/lib/log4j-1.2.12.jar (with props) jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/AvalonLogChute.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/HoldingLogChute.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/JdkLogChute.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/Log.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/LogChute.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/LogChuteSystem.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/NullLogChute.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/RuntimeLoggerLog.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/StandardOutLogChute.java Removed: jakarta/velocity/core/trunk/build/lib/log4j-1.2.8.jar Modified: jakarta/velocity/core/trunk/project.xml jakarta/velocity/core/trunk/src/java/org/apache/velocity/Template.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/EventHandlerUtil.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/implement/EscapeReference.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/implement/IncludeNotFound.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeConstants.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/VelocimacroManager.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/defaults/velocity.properties jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Foreach.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Include.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Macro.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/AvalonLogSystem.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogSystem.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/LogManager.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/LogSystem.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/NullLogSystem.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/PrimordialLogSystem.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/Parser.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTAddNode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTAndNode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTDivNode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTEQNode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTGENode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTGTNode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTIdentifier.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTIntegerRange.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTLENode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTLTNode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTModNode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTMulNode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTNENode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTSetDirective.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTStringLiteral.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTSubtractNode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/AbstractExecutor.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/BooleanPropertyExecutor.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/GetExecutor.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/ContentResource.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/ResourceCacheImpl.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarHolder.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoaderFactory.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/Introspector.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/UberspectImpl.java jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/introspection/UberspectLoggable.java jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ClassloaderChangeTestCase.java jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/EventHandlingTestCase.java jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ExternalLoggerTestCase.java jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/FilteredEventHandlingTestCase.java Added: jakarta/velocity/core/trunk/build/lib/log4j-1.2.12.jar URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/build/lib/log4j-1.2.12.jar?rev=292918&view=auto ============================================================================== Binary file - no diff available. Propchange: jakarta/velocity/core/trunk/build/lib/log4j-1.2.12.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Modified: jakarta/velocity/core/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/project.xml?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/project.xml (original) +++ jakarta/velocity/core/trunk/project.xml Fri Sep 30 21:36:58 2005 @@ -184,7 +184,7 @@ <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> - <version>1.2.11</version> + <version>1.2.12</version> <url>http://logging.apache.org/log4j/</url> <type>jar</type> <properties> Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/Template.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/Template.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/Template.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/Template.java Fri Sep 30 21:36:58 2005 @@ -268,7 +268,7 @@ String msg = "Template.merge() failure. The document is null, " + "most likely due to parsing error."; - rsvc.error(msg); + rsvc.getLog().error(msg); throw new Exception(msg); } } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/EventHandlerUtil.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/EventHandlerUtil.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/EventHandlerUtil.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/EventHandlerUtil.java Fri Sep 30 21:36:58 2005 @@ -59,7 +59,7 @@ } catch (Exception E) { - rsvc.error("Couldn't initialize event handler. " + E); + rsvc.getLog().error("Couldn't initialize event handler.", E); } } @@ -115,7 +115,7 @@ } catch (Exception E) { - rsvc.error("Couldn't initialize event handler. " + E); + rsvc.getLog().error("Couldn't initialize event handler.", E); } } @@ -178,7 +178,7 @@ } catch (Exception E) { - rsvc.error("Couldn't initialize event handler. " + E); + rsvc.getLog().error("Couldn't initialize event handler.", E); } } @@ -245,7 +245,7 @@ } catch (Exception E) { - rsvc.error("Couldn't initialize event handler. " + E); + rsvc.getLog().error("Couldn't initialize event handler.", E); } } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/implement/EscapeReference.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/implement/EscapeReference.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/implement/EscapeReference.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/implement/EscapeReference.java Fri Sep 30 21:36:58 2005 @@ -118,7 +118,8 @@ } catch (MalformedPerl5PatternException E) { - rs.error("Invalid regular expression '" + matchRegExp + "'. No escaping will be performed."); + rs.getLog().error("Invalid regular expression '" + matchRegExp + + "'. No escaping will be performed."); matchRegExp = null; } } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/implement/IncludeNotFound.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/implement/IncludeNotFound.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/implement/IncludeNotFound.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/implement/IncludeNotFound.java Fri Sep 30 21:36:58 2005 @@ -69,7 +69,7 @@ */ else { - rs.error("Can't find include not found page: " + notfound); + rs.getLog().error("Can't find include not found page: " + notfound); return null; } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeConstants.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeConstants.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeConstants.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeConstants.java Fri Sep 30 21:36:58 2005 @@ -87,6 +87,7 @@ /** * Log message prefixes */ + public final static String TRACE_PREFIX = " [trace] "; public final static String DEBUG_PREFIX = " [debug] "; public final static String INFO_PREFIX = " [info] "; public final static String WARN_PREFIX = " [warn] "; Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeInstance.java Fri Sep 30 21:36:58 2005 @@ -39,9 +39,7 @@ import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.velocity.runtime.directive.Directive; import org.apache.velocity.runtime.log.LogManager; -import org.apache.velocity.runtime.log.LogSystem; -import org.apache.velocity.runtime.log.NullLogSystem; -import org.apache.velocity.runtime.log.PrimordialLogSystem; +import org.apache.velocity.runtime.log.Log; import org.apache.velocity.runtime.parser.ParseException; import org.apache.velocity.runtime.parser.Parser; import org.apache.velocity.runtime.parser.node.SimpleNode; @@ -49,7 +47,6 @@ import org.apache.velocity.runtime.resource.ResourceManager; import org.apache.velocity.util.ClassUtils; import org.apache.velocity.util.SimplePool; -import org.apache.velocity.util.StringUtils; import org.apache.velocity.util.introspection.Introspector; import org.apache.velocity.util.introspection.Uberspect; import org.apache.velocity.util.introspection.UberspectLoggable; @@ -109,12 +106,12 @@ private VelocimacroFactory vmFactory = null; /** - * The Runtime logger. We start with an instance of - * a 'primordial logger', which just collects log messages - * then, when the log system is initialized, we dump - * all messages out of the primordial one into the real one. + * The Runtime logger. We start with an instance of + * a 'primordial logger', which just collects log messages + * then, when the log system is initialized, all the + * messages get dumpted out of the primordial one into the real one. */ - private LogSystem logSystem = new PrimordialLogSystem(); + private Log log = new Log(); /** * The Runtime parser pool @@ -195,7 +192,7 @@ * make a new introspector and initialize it */ - introspector = new Introspector( this ); + introspector = new Introspector(getLog()); /* * and a store for the application attributes @@ -228,7 +225,7 @@ info("Starting Jakarta Velocity v@version@"); info("RuntimeInstance initializing."); initializeProperties(); - initializeLogger(); + initializeLog(); initializeResourceManager(); initializeDirectives(); initializeEventHandlers(); @@ -289,7 +286,7 @@ if (uberSpect instanceof UberspectLoggable) { - ((UberspectLoggable) uberSpect).setRuntimeLogger(this); + ((UberspectLoggable) uberSpect).setLog(getLog()); } uberSpect.init(); @@ -646,32 +643,12 @@ * * @throws Exception */ - private void initializeLogger() throws Exception + private void initializeLog() throws Exception { - /* - * Initialize the logger. We will eventually move all - * logging into the logging manager. - */ - if (logSystem instanceof PrimordialLogSystem) - { - PrimordialLogSystem pls = (PrimordialLogSystem) logSystem; - logSystem = LogManager.createLogSystem(this); - - /* - * in the event of failure, lets do something to let it - * limp along. - */ - - if (logSystem == null) - { - logSystem = new NullLogSystem(); - } - else - { - pls.dumpLogMessages(logSystem); - } - } - } + // since the Log we started with was just placeholding, + // let's update it with the real LogChute settings. + LogManager.updateLog(this.log, this); + } /** @@ -1017,92 +994,43 @@ } /** - * Added this to check and make sure that the configuration - * is initialized before trying to get properties from it. - * This occurs when there are errors during initialization - * and the default properties have yet to be layed down. + * Returns a convenient Log instance that wraps the current LogChute. */ - private boolean showStackTrace() + public Log getLog() { - if (configuration.isInitialized()) - { - return getBoolean(RUNTIME_LOG_WARN_STACKTRACE, false); - } - else - { - return false; - } + return log; } /** - * Handle logging. - * - * @param level level of message to log - * @param message message to log - */ - private void log(int level, Object message) - { - String out; - - /* - * now, see if the logging stacktrace is on - * and modify the message to suit - */ - if (showStackTrace() && - (message instanceof Throwable || message instanceof Exception)) - { - out = StringUtils.stackTrace((Throwable)message); - } - else - { - out = message.toString(); - } - - /* - * just log it, as we are guaranteed now to have some - * kind of logger - save the if() - */ - logSystem.logVelocityMessage(level, out); - } - - /** - * Log a warning message. - * - * @param message message to log + * @deprecated Use getLog() and call warn() on it. */ public void warn(Object message) { - log(LogSystem.WARN_ID, message); + getLog().warn(message); } /** - * Log an info message. - * - * @param message message to log + * @deprecated Use getLog() and call info() on it. */ public void info(Object message) { - log(LogSystem.INFO_ID, message); + getLog().info(message); } /** - * Log an error message. - * - * @param message message to log + * @deprecated Use getLog() and call error() on it. */ public void error(Object message) { - log(LogSystem.ERROR_ID, message); + getLog().error(message); } /** - * Log a debug message. - * - * @param message message to log + * @deprecated Use getLog() and call debug() on it. */ public void debug(Object message) { - log(LogSystem.DEBUG_ID, message); + getLog().debug(message); } /** Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java Fri Sep 30 21:36:58 2005 @@ -25,6 +25,7 @@ import org.apache.velocity.exception.ParseErrorException; import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.velocity.runtime.directive.Directive; +import org.apache.velocity.runtime.log.Log; import org.apache.velocity.runtime.parser.ParseException; import org.apache.velocity.runtime.parser.node.SimpleNode; import org.apache.velocity.runtime.resource.ContentResource; @@ -335,6 +336,11 @@ * implemenation. */ public Uberspect getUberspect(); + + /** + * Returns a convenient Log instance that wraps the current LogChute. + */ + public Log getLog(); /** * Returns the event handlers for the application. Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/VelocimacroFactory.java Fri Sep 30 21:36:58 2005 @@ -316,7 +316,7 @@ "will not automatically reload global library macros"); } - rsvc.info("Velocimacro : initialization complete."); + rsvc.getLog().info("Velocimacro : initialization complete."); } return; @@ -369,7 +369,7 @@ Macro.macroToString(msg, argArray); msg.append(" : source = ").append(sourceTemplate); // Already checked for getBlather() - rsvc.info(msg.toString()); + rsvc.getLog().info(msg); } return true; @@ -452,7 +452,7 @@ { if (getBlather()) { - rsvc.info( s ); + rsvc.getLog().info(s); } } @@ -463,7 +463,7 @@ { if (getBlather()) { - rsvc.warn( s ); + rsvc.getLog().warn(s); } } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/VelocimacroManager.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/VelocimacroManager.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/VelocimacroManager.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/VelocimacroManager.java Fri Sep 30 21:36:58 2005 @@ -446,8 +446,8 @@ } catch ( Exception e ) { - rsvc.error("VelocimacroManager.parseTree() : exception " + - macroname + " : " + StringUtils.stackTrace(e)); + rsvc.getLog().error("VelocimacroManager.parseTree() : exception " + + macroname, e); } } } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/defaults/velocity.properties URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/defaults/velocity.properties?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/defaults/velocity.properties (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/defaults/velocity.properties Fri Sep 30 21:36:58 2005 @@ -10,10 +10,10 @@ #---------------------------------------------------------------------------- #---------------------------------------------------------------------------- -# default LogSystem to use: default: AvalonLogSystem +# default LogChute to use: default: AvalonLogChute, Log4JLogChute, JdkLogChute #---------------------------------------------------------------------------- -runtime.log.logsystem.class = org.apache.velocity.runtime.log.AvalonLogSystem,org.apache.velocity.runtime.log.SimpleLog4JLogSystem +runtime.log.logsystem.class = org.apache.velocity.runtime.log.AvalonLogChute,org.apache.velocity.runtime.log.Log4JLogChute,org.apache.velocity.runtime.log.JdkLogChute #--------------------------------------------------------------------------- # This is the location of the Velocity Runtime log. @@ -31,30 +31,6 @@ runtime.log.warn.stacktrace = false runtime.log.info.stacktrace = false runtime.log.invalid.references = true - -#---------------------------------------------------------------------------- -# Configuration for the Log4JLogSystem. -# You must define the runtime.log.logsystem.class property to be: -# org.apache.velocity.runtime.log.Log4JLogSystem -# -# You must also include Log4J's .jar files into your classpath. They are -# included with the Velocity distribution in the build/lib directory. -# -# There are several different options that you can configure. -# Uncomment the ones that you want and also define their settings. -#---------------------------------------------------------------------------- -#runtime.log.logsystem.log4j.pattern=%d - %m%n -#runtime.log.logsystem.log4j.file.size=100000 -#runtime.log.logsystem.log4j.file.backups=1 -#runtime.log.logsystem.log4j.syslogd.host=my.syslog.server.com -#runtime.log.logsystem.log4j.syslogd.facility=LOG_DAEMON -#runtime.log.logsystem.log4j.remote.host=my.remote.server.com -#runtime.log.logsystem.log4j.remote.port=1099 -#runtime.log.logsystem.log4j.email.server=localhost -#runtime.log.logsystem.log4j.email.from=root@localhost -#runtime.log.logsystem.log4j.email.to=root@localhost -#runtime.log.logsystem.log4j.email.subject=Velocity Error Report -#runtime.log.logsystem.log4j.email.buffer.size=512 #---------------------------------------------------------------------------- # T E M P L A T E E N C O D I N G Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Foreach.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Foreach.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Foreach.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Foreach.java Fri Sep 30 21:36:58 2005 @@ -367,7 +367,7 @@ } catch(Exception ee) { - rsvc.error("Error getting iterator for #foreach : " + ee.getMessage()); + rsvc.getLog().error("Error getting iterator for #foreach", ee); } if (i == null) Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Include.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Include.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Include.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Include.java Fri Sep 30 21:36:58 2005 @@ -140,8 +140,8 @@ } else { - rsvc.error("#include() error : invalid argument type : " - + n.toString()); + rsvc.getLog().error("#include() invalid argument type: " + + n.toString()); outputErrorToStream( writer, "error with arg " + i + " please see log."); } @@ -165,7 +165,7 @@ { if ( node == null ) { - rsvc.error("#include() error : null argument"); + rsvc.getLog().error("#include() null argument"); return false; } @@ -175,7 +175,7 @@ Object value = node.value( context ); if ( value == null) { - rsvc.error("#include() error : null argument"); + rsvc.getLog().error("#include() null argument"); return false; } @@ -210,20 +210,19 @@ /* * the arg wasn't found. Note it and throw */ - - rsvc.error("#include(): cannot find resource '" + arg + - "', called from template " + - context.getCurrentTemplateName() + " at (" + - getLine() + ", " + getColumn() + ")" ); + rsvc.getLog().error("#include(): cannot find resource '" + arg + + "', called from template " + + context.getCurrentTemplateName() + " at (" + + getLine() + ", " + getColumn() + ")" ); throw rnfe; } catch (Exception e) { - rsvc.error("#include(): arg = '" + arg + - "', called from template " + - context.getCurrentTemplateName() + " at (" + - getLine() + ", " + getColumn() + ") : " + e); + rsvc.getLog().error("#include(): arg = '" + arg + + "', called from template " + + context.getCurrentTemplateName() + " at (" + + getLine() + ", " + getColumn() + ')', e); } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Macro.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Macro.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Macro.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Macro.java Fri Sep 30 21:36:58 2005 @@ -135,8 +135,8 @@ * define a block */ - rs.error("#macro error : Velocimacro must have name as 1st " + - "argument to #macro(). #args = " + numArgs); + rs.getLog().error("#macro error : Velocimacro must have name as 1st " + + "argument to #macro(). #args = " + numArgs); throw new MacroParseException("First argument to #macro() must be " + " macro name."); @@ -193,7 +193,7 @@ StringBuffer msg = new StringBuffer("Failed to add macro: "); macroToString(msg, argArray); msg.append(" : source = ").append(sourceTemplate); - rs.warn(msg.toString()); + rs.getLog().warn(msg); } } @@ -251,7 +251,7 @@ StringBuffer msg = new StringBuffer("Macro.getArgArray() : nbrArgs="); msg.append(numArgs).append(" : "); macroToString(msg, argArray); - rsvc.debug(msg.toString()); + rsvc.getLog().debug(msg); } return argArray; Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java Fri Sep 30 21:36:58 2005 @@ -85,7 +85,7 @@ */ if ( node.jjtGetChild(0) == null) { - rsvc.error( "#parse() error : null argument" ); + rsvc.getLog().error("#parse() null argument"); return false; } @@ -96,7 +96,7 @@ if ( value == null) { - rsvc.error( "#parse() error : null argument" ); + rsvc.getLog().error("#parse() null argument"); return false; } @@ -137,8 +137,9 @@ path.append( " > " + templateStack[i] ); } - rsvc.error( "Max recursion depth reached (" + - templateStack.length + ")" + " File stack:" + path ); + rsvc.getLog().error("Max recursion depth reached (" + + templateStack.length + ')' + " File stack:" + + path); return false; } @@ -158,11 +159,10 @@ /* * the arg wasn't found. Note it and throw */ - - rsvc.error("#parse(): cannot find template '" + arg + - "', called from template " + - context.getCurrentTemplateName() + " at (" + - getLine() + ", " + getColumn() + ")" ); + rsvc.getLog().error("#parse(): cannot find template '" + arg + + "', called from template " + + context.getCurrentTemplateName() + " at (" + + getLine() + ", " + getColumn() + ")" ); throw rnfe; } catch ( ParseErrorException pee ) @@ -172,16 +172,16 @@ * note it and throw */ - rsvc.error("#parse(): syntax error in #parse()-ed template '" + - arg + "', called from template " + - context.getCurrentTemplateName() + " at (" + - getLine() + ", " + getColumn() + ")" ); + rsvc.getLog().error("#parse(): syntax error in #parse()-ed template '" + + arg + "', called from template " + + context.getCurrentTemplateName() + " at (" + + getLine() + ", " + getColumn() + ")" ); throw pee; } catch ( Exception e) { - rsvc.error("#parse() : arg = " + arg + ". Exception : " + e); + rsvc.getLog().error("#parse() : arg = " + arg + '.', e); return false; } @@ -206,7 +206,7 @@ throw (MethodInvocationException) e; } - rsvc.error( "Exception rendering #parse( " + arg + " ) : " + e ); + rsvc.getLog().error("Exception rendering #parse(" + arg + ')', e); return false; } finally Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java Fri Sep 30 21:36:58 2005 @@ -22,6 +22,7 @@ import org.apache.velocity.context.InternalContextAdapter; import org.apache.velocity.context.InternalContextAdapterImpl; +import org.apache.velocity.runtime.log.Log; import org.apache.velocity.runtime.RuntimeServices; import org.apache.velocity.runtime.parser.node.ASTReference; import org.apache.velocity.runtime.parser.ParserTreeConstants; @@ -106,6 +107,7 @@ private final int GENERALSTATIC = -1; private RuntimeServices rsvc = null; + private Log log = null; /** * ctor for current impl @@ -120,6 +122,7 @@ public VMProxyArg( RuntimeServices rs, String contextRef, String callerRef, int t ) { rsvc = rs; + log = rsvc.getLog(); contextReference = contextRef; callerReference = callerRef; @@ -193,7 +196,7 @@ } catch( MethodInvocationException mie ) { - rsvc.error("VMProxyArg.getObject() : method invocation error setting value : " + mie ); + log.error("VMProxyArg.getObject() : method invocation error setting value", mie); } } else @@ -220,8 +223,8 @@ type = GENERALSTATIC; staticObject = o; - rsvc.error("VMProxyArg.setObject() : Programmer error : I am a constant! No setting! : " - + contextReference + " / " + callerReference); + log.error("VMProxyArg.setObject() : Programmer error : I am a constant! No setting! : " + + contextReference + " / " + callerReference); } return null; @@ -318,7 +321,7 @@ } catch (Exception e ) { - rsvc.error("VMProxyArg.getObject() : error rendering reference : " + e ); + log.error("VMProxyArg.getObject() : error rendering reference", e); } } else if( type == GENERALSTATIC ) @@ -327,7 +330,9 @@ } else { - rsvc.error("Unsupported VM arg type : VM arg = " + callerReference +" type = " + type + "( VMProxyArg.getObject() )"); + log.error("Unsupported VM arg type : VM arg = " + + callerReference +" type = " + type + + "( VMProxyArg.getObject() )"); } return retObject; @@ -341,7 +346,7 @@ * I can think of */ - rsvc.error("VMProxyArg.getObject() : method invocation error getting value : " + mie ); + log.error("VMProxyArg.getObject() : method invocation error getting value", mie); return null; } @@ -399,7 +404,7 @@ if ( nodeTree != null && nodeTree.getType() != type ) { - rsvc.error( "VMProxyArg.setup() : programmer error : type doesn't match node type."); + log.error("VMProxyArg.setup() : programmer error : type doesn't match node type."); } /* @@ -416,8 +421,8 @@ } catch ( Exception e ) { - rsvc.error("VMProxyArg.setup() : exception " + callerReference + - " : " + StringUtils.stackTrace(e)); + log.error("VMProxyArg.setup() : exception " + + callerReference, e); } break; @@ -457,8 +462,8 @@ * this is technically an error... */ - rsvc.error("Unsupported arg type : " + callerReference - + " You most likely intended to call a VM with a string literal, so enclose with ' or \" characters. (VMProxyArg.setup())"); + log.error("Unsupported arg type : " + callerReference + + " You most likely intended to call a VM with a string literal, so enclose with ' or \" characters. (VMProxyArg.setup())"); constant = true; staticObject = new String( callerReference ); @@ -467,8 +472,8 @@ default : { - rsvc.error(" VMProxyArg.setup() : unsupported type : " - + callerReference ); + log.error("VMProxyArg.setup() : unsupported type : " + + callerReference ); } } } Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java?rev=292918&r1=292917&r2=292918&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java Fri Sep 30 21:36:58 2005 @@ -173,7 +173,7 @@ } else { - rsvc.error( "VM error : " + macroName + ". Null AST"); + rsvc.getLog().error("VM error " + macroName + ". Null AST"); } } catch ( Exception e ) @@ -187,8 +187,8 @@ throw (MethodInvocationException) e; } - rsvc.error("VelocimacroProxy.render() : exception VM = #" + macroName + - "() : " + StringUtils.stackTrace(e)); + rsvc.getLog().error("VelocimacroProxy.render() : exception VM = #" + + macroName + "()", e); } return true; @@ -216,10 +216,10 @@ if ( getNumArgs() != i ) { - rsvc.error("VM #" + macroName + ": error : too " - + ( (getNumArgs() > i) ? "few" : "many") + " arguments to macro. Wanted " - + getNumArgs() + " got " + i ); - + rsvc.getLog().error("VM #" + macroName + ": error : too " + + ((getNumArgs() > i) ? "few" : "many") + + " arguments to macro. Wanted " + getNumArgs() + + " got " + i); return; } @@ -302,8 +302,8 @@ } catch ( Exception e ) { - rsvc.error("VelocimacroManager.parseTree() : exception " + macroName + - " : " + StringUtils.stackTrace(e)); + rsvc.getLog().error("VelocimacroManager.parseTree() : exception " + + macroName, e); } } Added: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/AvalonLogChute.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/AvalonLogChute.java?rev=292918&view=auto ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/AvalonLogChute.java (added) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/AvalonLogChute.java Fri Sep 30 21:36:58 2005 @@ -0,0 +1,223 @@ +/* + * Copyright 2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.velocity.runtime.log; + +import java.io.File; +import org.apache.log.Priority; +import org.apache.log.Logger; +import org.apache.log.Hierarchy; +import org.apache.log.LogTarget; +import org.apache.log.output.io.FileTarget; +import org.apache.velocity.runtime.RuntimeServices; +import org.apache.velocity.runtime.RuntimeConstants; + +/** + * Implementation of a Avalon logger. + * + * @author <a href="mailto:alyssa14@example.net">Jon S. Stevens</a> + * @author <a href="mailto:alyssa14@example.net">Geir Magnusson Jr.</a> + * @author <a href="mailto:alyssa14@example.net">Nathan Bubna</a> + * @version $Id: AvalonLogChute.java 292075 2005-09-28 00:08:12Z dlr $ + */ +public class AvalonLogChute implements LogChute +{ + private Logger logger = null; + + private RuntimeServices rsvc = null; + + /** + * default CTOR. Initializes itself using the property RUNTIME_LOG + * from the Velocity properties + */ + + public AvalonLogChute() + { + } + + public void init( RuntimeServices rs ) + throws Exception + { + this.rsvc = rs; + + /* + * if a logger is specified, we will use this instead of + * the default + */ + String loggerName = (String) rsvc.getProperty("runtime.log.logsystem.avalon.logger"); + + if (loggerName != null) + { + this.logger = Hierarchy.getDefaultHierarchy().getLoggerFor(loggerName); + } + else + { + /* + * since this is a Velocity-provided logger, we will + * use the Runtime configuration + */ + String logfile = (String) rsvc.getProperty( RuntimeConstants.RUNTIME_LOG ); + + /* + * now init. If we can't, panic! + */ + try + { + init( logfile ); + + log( 0, + "AvalonLogChute initialized using logfile '" + logfile + "'" ); + } + catch( Exception e ) + { + System.err.println( + "PANIC : Error configuring AvalonLogChute : " + e ); + + throw new Exception("Unable to configure AvalonLogChute : " + e ); + } + } + } + + /** + * initializes the log system using the logfile argument + * + * @param logFile file for log messages + */ + public void init(String logFile) + throws Exception + { + + /* + * make our FileTarget. Note we are going to keep the + * default behavior of not appending... + */ + FileTarget target = new FileTarget( new File( logFile), + false, + new VelocityFormatter("%{time} %{message}\\n%{throwable}" ) ); + + /* + * use the toString() of RuntimeServices to make a unique logger + */ + + logger = Hierarchy.getDefaultHierarchy().getLoggerFor( rsvc.toString() ); + logger.setPriority( Priority.DEBUG ); + logger.setLogTargets( new LogTarget[] { target } ); + } + + /** + * logs messages + * + * @param level severity level + * @param message complete error message + */ + public void log(int level, String message) + { + /* + * based on level, call teh right logger method + * and prefix with the appropos prefix + */ + + switch (level) + { + case LogChute.WARN_ID: + logger.warn( RuntimeConstants.WARN_PREFIX + message ); + break; + case LogChute.INFO_ID: + logger.info( RuntimeConstants.INFO_PREFIX + message); + break; + case LogChute.DEBUG_ID: + logger.debug( RuntimeConstants.DEBUG_PREFIX + message); + break; + case LogChute.TRACE_ID: + logger.debug(RuntimeConstants.TRACE_PREFIX + message); + break; + case LogChute.ERROR_ID: + logger.error(RuntimeConstants.ERROR_PREFIX + message); + break; + default: + logger.info( message); + break; + } + } + +
{'source': 'Apache Software Foundation Public Mail Archives'}