View Javadoc

1   /*
2    * Created on 1-jul.-2006 */
3   package DTDDoc;
4   
5   
6   /** A logger class that should be compatible with Ant and Maven's log.
7    *
8    * This class was introduced to abstract the details of Ant and Maven's
9    * logging. This is needed because when DTDDoc works as an Ant task
10   * we use Ant for logs but when we're under Maven we use Maven's log.
11   *
12   * @author Stefan Champailler schampailler_at_skynet_dot_be */
13  
14  
15  public abstract class Logger {
16  
17      /** Logs an informational message. Such a message never indicates
18  	 *  a problem to the user.
19  	 *
20  	 * @param msg Message to log. */
21  	 
22      public abstract void info( String msg);
23  
24      /** Logs a warning message. Such a message indicates a problem
25  	 *  to the user. The problem doesn't affect the course of 
26  	 *  DTDDoc but is worth noting because it's the result of a
27  	 *  an action or the data of the user.
28  	 *
29  	 * @param msg Message to log. */
30  	 
31      public abstract void warn( String msg);
32  	
33      /** Logs an error message. Such a message indicates something
34  	 *  wrong happened inside DTDDoc. This thing may affect the
35  	 *  course of execution of DTDDoc. That is, if it happens, the
36  	 *  result of the execution is not guaranteed.
37  	 *
38  	 * @param msg Message to log. */
39  	
40  	public abstract void error( String msg);
41  	
42  	/** Logs an error message and an associated exception (stack trace).
43  	 *
44  	 *  @see #error( String msg)
45  	 *  @param msg Message to log.
46  	 *  @param ex Exception to log. */
47  	 
48      public void error( String msg, Exception ex) {
49          error( msg);
50  		error( ex.toString());
51      }
52  
53  }
54