View Javadoc

1   /*
2    * Created on 1-jul.-2006 */
3   package DTDDoc;
4   
5   import org.apache.tools.ant.Project;
6   import org.apache.tools.ant.Task;
7   
8   /** A logger that is logging through Ant's logging API.
9    *
10   * @author Stefan Champailler schampailler_at_skynet_dot_be */
11  
12  
13  public class AntLogger extends Logger {
14  	
15  	private Task antTask;
16  	
17  	public AntLogger( Task task) {
18  		antTask = task;
19  	}
20  	
21      public void warn( String msg) {
22          // FIXME By default Ant shows the warning message with the
23          // very same "layout" as info messages. Therefore warnings
24          // are hard to spot. For this reason, we add the WARNING
25          // tag in front of our message. However, it is to be noted
26          // that this should not be like taht. Afterall, if one
27          // clearly specifies that a message is a warning, then
28          // the logging mechanism should make it apppear as such.
29  
30          antTask.log( "WARNING: " + msg, Project.MSG_WARN);
31      }
32  
33      public void error( String msg) {
34          // FIXME Same "presentation" issue as for the Warnings...
35  		antTask.log( "ERROR: " + msg, Project.MSG_ERR);
36      }
37  
38      public void info( String msg) {
39  		antTask.log( msg);
40      }
41  
42  }
43