KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > javaguard > log > Log


1 /**
2  * JavaGuard -- an obfuscation package for Java classfiles.
3  *
4  * Copyright (c) 2002 Thorsten Heit (theit@gmx.de)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * The author may be contacted at theit@gmx.de.
21  *
22  *
23  * $Id: Log.java,v 1.2 2002/04/23 11:18:39 glurk Exp $
24  */

25 package net.sf.javaguard.log;
26
27
28 /** Contains common constants used by the logger classes.
29  *
30  * @author <a HREF="mailto:theit@gmx.de">Thorsten Heit</a>
31  */

32 public interface Log {
33   /** The <code>int</code> value representing a normal logging level. */
34   public static final int NORMAL = 0;
35   /** The <code>int</code> value representing an informational logging level. */
36   public static final int INFO = 1;
37   /** The <code>int</code> value representing a verbose logging level. */
38   public static final int VERBOSE = 2;
39   /** The <code>int</code> value representing a debug logging level. */
40   public static final int DEBUG = 3;
41   
42   
43   
44   
45   /** Sets the logging level. Future log messages must have a logging level
46    * equal or higher to the one specified in the parameter.
47    * @param level the new logging level; one of the constants
48    * <code>NORMAL</code>, <code>INFO</code>, <code>VERBOSE</code> or <code>DEBUG</code>
49    * @see #getLoggingLevel
50    */

51   public void setLoggingLevel(int level);
52   
53   
54   /** Returns the current logging level.
55    * @return the current logging level
56    */

57   public int getLoggingLevel();
58   
59   
60   /** Increment the current logging level to be more verbose.
61    */

62   public void incrementLoggingLevel();
63   
64   
65   
66   
67   /** Prints an empty line to the logger using the <code>NORMAL</code> logging
68    * level.
69    * @see #log
70    */

71   public void println();
72   
73   
74   /** Prints the given string to the logger using the <code>NORMAL</code>
75    * logging level and terminates the current line.
76    * @param msg the message to log
77    */

78   public void println(String JavaDoc msg);
79   
80   
81   /** Prints the given string to the logger using the <code>NORMAL</code>
82    * logging level.
83    * @param msg the message to log
84    */

85   public void print(String JavaDoc msg);
86   
87   
88   /** Prints the given string to the logger using the <code>NORMAL</code>
89    * logging level and terminates the current line.
90    * @param msg the message to log
91    */

92   public void log(String JavaDoc msg);
93   
94   
95   /** Prints a logging message and terminates the line if the specified logging
96    * level is lower or equal than the current logging level.
97    * @param level the logging level
98    * @param msg the log message
99    */

100   public void log(int level, String JavaDoc msg);
101   
102   
103   /** Prints a logging message if the specified logging level is lower or equal
104    * than the current logging level. Depending on the <code>lineFeed</code>
105    * parameter the output line is terminated.
106    * @param level the logging level
107    * @param msg the log message
108    * @param lineFeed true if the output line is terminated; false else
109    */

110   public void log(int level, String JavaDoc msg, boolean lineFeed);
111   
112   
113   
114   
115   /** Logs the stack trace of the given exception.
116    * @param ex the exception whose stack trace should be logged
117    */

118   public void printStackTrace(Exception JavaDoc ex);
119 }
120
Popular Tags