While we're talking about this logging issue.... We can define a Logger interface with all those handy warn/debug/etc methods in it. Then derive two classes from it: one which uses log4j (Log4JLogger) and another one which does only simple formatting (SimpleLogger). We can also define a log() method which acts as System.out.println(). This log() method delegates to Ant's Task.log() so Ant will be happy about logging. Also SimpleLogger will simply delegate to Ant's log method. So in runtime by default SimpleLogger will be used, but if user sets verbose="true" Log4JLogger will be used. It also has another added benefit: we can switch to log4j 1.2 easier, it's all in Log4JLogger. Or even use JDK1.4's log system!
Idea? Anyone interested in implementing it? Ara. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:xdoclet-devel- > [EMAIL PROTECTED]] On Behalf Of Erik Hatcher > Sent: Sunday, April 14, 2002 9:47 PM > To: [EMAIL PROTECTED]; Vincent Harcq > Subject: Re: [Xdoclet-devel] CVS update: xdoclet/core/src/xdoclet > DocletTask.java > > I'd recommend using: > > log( "Adding " + dir + " " + files[j], Project.MSG_DEBUG); > > instead. While System.out.println works fine, its best to use the log > methods. Plus you probably only want those messages in -debug mode > anyway, > right? > > Erik > > > ----- Original Message ----- > From: "Vincent Harcq" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Sunday, April 14, 2002 12:58 PM > Subject: [Xdoclet-devel] CVS update: xdoclet/core/src/xdoclet > DocletTask.java > > > > User: vharcq > > Date: 02/04/14 09:58:18 > > > > Modified: core/src/xdoclet DocletTask.java > > Log: > > This is not a bad idea to show the list of files that xdoclet consider > at all times (not specially in debug mode) > > > > Revision Changes Path > > 1.35 +5 -1 xdoclet/core/src/xdoclet/DocletTask.java > > > > Index: DocletTask.java > > =================================================================== > > RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/DocletTask.java,v > > retrieving revision 1.34 > > retrieving revision 1.35 > > diff -u -w -r1.34 -r1.35 > > --- DocletTask.java 12 Apr 2002 21:01:58 -0000 1.34 > > +++ DocletTask.java 14 Apr 2002 16:58:18 -0000 1.35 > > @@ -35,7 +35,7 @@ > > * @author Ara Abrahamian ([EMAIL PROTECTED]) > > * @author <a href="mailto:[EMAIL PROTECTED]">Aslak > Helles�y</a> > > * @created June 19, 2001 > > - * @version $Revision: 1.34 $ > > + * @version $Revision: 1.35 $ > > */ > > public class DocletTask extends Task > > { > > @@ -368,6 +368,10 @@ > > DirectoryScanner ds = fs.getDirectoryScanner( project ); > > String[] files = ds.getIncludedFiles(); > > > > + for( int j = 0; j < files.length; j++ ) > > + { > > + System.out.println( "Adding " + dir + " " + files[j] ); > > + } > > sourceSets[i] = new SourceSet( dir, files ); > > } > > > > > > > > > > > > _______________________________________________ > > Xdoclet-devel mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/xdoclet-devel > > > > > _______________________________________________ > Xdoclet-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/xdoclet-devel _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel
