001: /*
002: * Copyright 2006 Pentaho Corporation. All rights reserved.
003: * This software was developed by Pentaho Corporation and is provided under the terms
004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005: * this file except in compliance with the license. If you need a copy of the license,
006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
007: * BI Platform. The Initial Developer is Pentaho Corporation.
008: *
009: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
011: * the license for the specific language governing your rights and limitations.
012: *
013: * @created May 3, 2005
014: * @author James Dixon
015: *
016: */
017: package org.pentaho.util.logging;
018:
019: /**
020: * The Logger is the main interface into the platform's logging subsystem.
021: * <p>
022: * Note: Documentation taken from <a
023: * href="http://logging.apache.org/log4j/docs/api/index.html"
024: * target="_blank">Log4j Javadoc documentation.</a>
025: */
026: public interface ILogger {
027:
028: /**
029: * The TRACE has the lowest possible rank and is intended to turn on all
030: * logging.
031: */
032: public static final int TRACE = 1;
033:
034: /**
035: * The DEBUG Level designates fine-grained informational events that are
036: * most useful to debug an application.
037: */
038: public static final int DEBUG = 2;
039:
040: /**
041: * The INFO level designates informational messages that highlight the
042: * progress of the application at coarse-grained level.
043: */
044: public static final int INFO = 3;
045:
046: /**
047: * The WARN level designates potentially harmful situations.
048: */
049: public static final int WARN = 4;
050:
051: /**
052: * The ERROR level designates error events that might still allow the
053: * application to continue running.
054: */
055: public static final int ERROR = 5;
056:
057: /**
058: * The FATAL level designates very severe error events that will presumably
059: * lead the application to abort.
060: */
061: public static final int FATAL = 6;
062:
063: public static final int UNKNOWN = 100;
064:
065: public static final String SOLUTION_LOG = "solution"; //$NON-NLS-1$
066:
067: public static final String ACTIVITY_LOG = "activity"; //$NON-NLS-1$
068:
069: public static final String INSTANCE_LOG = "instance"; //$NON-NLS-1$
070:
071: public static final String SESSION_LOG = "session"; //$NON-NLS-1$
072:
073: /**
074: * Return the logging level for this Logger.
075: *
076: * @return logging level
077: */
078: public int getLoggingLevel();
079:
080: /**
081: * Set the logging level for this Logger.
082: * <p>
083: * Valid logging levels are {@link #TRACE TRACE}, {@link #DEBUG DEBUG},
084: * {@link #INFO INFO}, {@link #WARN WARN}, {@link #ERROR ERROR}, and
085: * {@link #FATAL FATAL}.
086: *
087: * @param loggingLevel
088: */
089: public void setLoggingLevel(int loggingLevel);
090:
091: /**
092: * Log a message object with the {@link #TRACE TRACE} Level.
093: *
094: * @param message
095: * the message object to log.
096: */
097: public void trace(String message);
098:
099: /**
100: * Log a message object with the {@link #DEBUG DEBUG} Level.
101: *
102: * @param message
103: * the message object to log.
104: */
105: public void debug(String message);
106:
107: /**
108: * Log a message object with the {@link #INFO INFO} Level.
109: *
110: * @param message
111: * the message object to log.
112: */
113: public void info(String message);
114:
115: /**
116: * Log a message object with the {@link #WARN WARN} Level.
117: *
118: * @param message
119: * the message object to log.
120: */
121: public void warn(String message);
122:
123: /**
124: * Log a message object with the {@link #ERROR ERROR} Level.
125: *
126: * @param message
127: * the message object to log.
128: */
129: public void error(String message);
130:
131: /**
132: * Log a message object with the {@link #FATAL FATAL} Level.
133: *
134: * @param message
135: * the message object to log.
136: */
137: public void fatal(String message);
138:
139: /**
140: * Log a message with the {@link #TRACE TRACE} level including the stack
141: * trace of the Throwable error passed as parameter.
142: *
143: * @param message
144: * the message object to log.
145: * @param error
146: * the exception to log, including its stack trace.
147: */
148: public void trace(String message, Throwable error);
149:
150: /**
151: * Log a message with the {@link #DEBUG DEBUG} level including the stack
152: * trace of the Throwable error passed as parameter.
153: *
154: * @param message
155: * the message object to log.
156: * @param error
157: * the exception to log, including its stack trace.
158: */
159: public void debug(String message, Throwable error);
160:
161: /**
162: * Log a message with the {@link #INFO INFO} level including the stack trace
163: * of the Throwable error passed as parameter.
164: *
165: * @param message
166: * the message object to log.
167: * @param error
168: * the exception to log, including its stack trace.
169: */
170: public void info(String message, Throwable error);
171:
172: /**
173: * Log a message with the {@link #WARN WARN} level including the stack trace
174: * of the Throwable error passed as parameter.
175: *
176: * @param message
177: * the message object to log.
178: * @param error
179: * the exception to log, including its stack trace.
180: */
181: public void warn(String message, Throwable error);
182:
183: /**
184: * Log a message with the {@link #ERROR ERROR} level including the stack
185: * trace of the Throwable error passed as parameter.
186: *
187: * @param message
188: * the message object to log.
189: * @param error
190: * the exception to log, including its stack trace.
191: */
192: public void error(String message, Throwable error);
193:
194: /**
195: * Log a message with the {@link #FATAL FATAL} level including the stack
196: * trace of the Throwable error passed as parameter.
197: *
198: * @param message
199: * the message object to log.
200: * @param error
201: * the exception to log, including its stack trace.
202: */
203: public void fatal(String message, Throwable error);
204:
205: }
|