tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glenn Vanderburg" <gvanderb...@delphis.com>
Subject Re: Still playing around with Ant
Date Mon, 29 Nov 1999 13:09:12 GMT
James Duncan Davidson <james.davidson@eng.sun.com> writes:
>
> I don't like the task knowing that the logging should be in XML terms.
> The task should be able to write without caring and the end result log
> is xml'ized.

Agreed.

> Also, I don't see a substantial difference between calling
> 
> 	project.log("foo");
> 	
> 	and
> 
> 	task.setLog(log);
> 	log.write("foo");

I do.  The first is better in every way.  :-)

When you have knowledge that a bunch of objects seem to need, it's
always better to wrap that up in a method that they all call (so that
only one object needs to know) than to try to go around telling
everyone.  The project.log solution hides several pieces of
information about logging in the project:

  - the log syntax
  - the destination of log messages
  - the fact that logging is done via a Writer

This is all good.  Those things are all attributes (using the plain
ol' English meaning of "attributes") of the project, not of each
individual task.  And hiding that knowledge in one place buys lots of
flexibility later (we could add a new log syntax, do replicated
logging, or log to a database (or some preexisting network logging
facility) rather than a file, for example).

I wouldn't mind seeing an optional logLevel parameter, although that
might be overkill for an application like Ant.

-- 
Glenn Vanderburg
Delphi Consultants, LLC
glv@delphis.com


Mime
View raw message