Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: javatools/util/Log.java


1   /*
2       Javatools (modified version) - Some useful general classes.
3       Copyright (C) 2002-2003  Chris Bitmead (original) Antonio Petrelli (modified)
4   
5       This program is free software; you can redistribute it and/or modify
6       it under the terms of the GNU General Public License as published by
7       the Free Software Foundation; either version 2 of the License, or
8       (at your option) any later version.
9   
10      This program is distributed in the hope that it will be useful,
11      but WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13      GNU General Public License for more details.
14  
15      You should have received a copy of the GNU General Public License
16      along with this program; if not, write to the Free Software
17      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  
19      Contact me at: brenmcguire@users.sourceforge.net
20   */
21  package javatools.util;
22  
23  /** An object that represents a log.
24   * @author Chris Bitmead
25   * @version 0.7
26   * @commentedby Antonio Petrelli
27   */
28  public interface Log {
29  
30    /** An informational message for programmers eyes only.*/
31    public static final int DEBUG   = 0;
32  
33    /** Informational message only to highlight an event of interest. */
34    public static final int INFO    = 1;
35  
36    /** An unexpected benign event which indicates a possible future error. */
37    public static final int WARNING = 2;
38  
39    /** A recoverable error condition. */
40    public static final int ERROR   = 3;
41  
42    /** A fatal event which prevents the system or sub/system from continuing. */
43    public static final int SEVERE  = 4;
44  
45    // Display names for severity. For example names[ERROR] returns "ERROR"
46          /** The names containing the kind of errors shown above.
47           */        
48    static final String[] names = {"DEBUG", "INFO", "WARNING", "ERROR", "SEVERE"};
49  
50    //  public void write(String sID, String sMessage);
51  
52    //  public void write(int severity, String sID, String sMessage)
53          /** Puts a message in the log.
54           * @param severity The severity of the message.
55           * @param sID The ID of the message.
56           * @param sMessage The message to put.
57           */        
58    void log(int severity, String sID, String sMessage);
59  
60          /** Puts a debug message in the log.
61           * @param sID The ID of the message.
62           * @param sMessage The message to put.
63           */        
64    void debug(String sID, String sMessage);
65          /** Puts an info message in the log.
66           * @param sID The ID of the message.
67           * @param sMessage The message to put.
68           */        
69    void info(String sID, String sMessage);
70          /** Puts a warning message in the log.
71           * @param sID The ID of the message.
72           * @param sMessage The message to put.
73           */        
74    void warning(String sID, String sMessage);
75          /** Puts an error message in the log.
76           * @param sID The ID of the message.
77           * @param sMessage The message to put.
78           */        
79    void error(String sID, String sMessage);
80          /** Puts a severe error message in the log.
81           * @param sID The ID of the message.
82           * @param sMessage The message to put.
83           */        
84    void severe(String sID, String sMessage);
85  }