Hello, Wrote a Velocity to Ant Task logging adapter as a Velocity LogSystem implementation described in the my proposal message (http://marc.theaimsgroup.com/?l=velocity-dev&m=101365562627409&w=2) except for in the first section where a default log file name is mentioned.
Now when using the <dvsl> task, all Velocity messages will be by default
routed to the corresponding Ant logging level and no longer written to a
file. They are now displayed whereever Ant's logging has been directed
(if it has been redirected) and are subject to any Ant logger specified
with the -logger option.
In addition, running Ant with different logging levels will display an
appropriate level of Velocity messages.
ant -quiet --> display error messages
ant --> display errors and warnings
In this default case, you don't see all the noise messages.
ant -verbose --> display errors, warnings and informationals
If you want to see the noise messages, use this level.
ant -debug --> display all of the above plus debug messages
To provide more flexibility and a level of backward compatibility, a new
logfile attribute can be specified to the <dvsl> task. This provides
logging in a manner compatible with the previous behavior but in a more
friendly way as the filename can easily be specified. For instance,
<dvsl logfile="${basedir}/docs.log" ... />
In addition, when Ant is run with either the -verbose or -debug options,
it will also output the processing time it took on the file:
Processed foo.xml in 185 ms.
This restores functionality available in the original version of the DVSL
Task (although in a slightly different manner).
Changes:
File: DVSL.java
* Added a setLogFile method.
* Added a setLogSystem method which takes a class instance that implements
the LogSystem interface.
* Modified the setVelocityConfig method to merge any existing Velocity
properties into the passed Map.
* Cleaned up imports sorting and removing unnecessary ones.
* Javadoc cleanup.
File: DVSLTask.java
* Added a setLogFile method.
* Modified the execute method to set the log filename if specified,
otherwise instantiate the AntLogSystem class passing it to the DVSL
instance.
* Javadoc cleanup; removed extranious comments
File: xdocs/ant_task_reference.xml
* Updated to describe new logging behavior.
* Added missing description of outputencoding attribute.
Additions:
File: AntLogSystem.java
* Implements the Velocity LogSystem interface directing messages to a
specified Ant Task instance.
Right now the AntLogSystem class is in the .dvsl package. Is that okay or
should I create a new package for it?
-Bill
velocity-dvsl-logging.zip
Description: application/unknown-content-type-winzip
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
