01: /* ========================================================================
02: * JCommon : a free general purpose class library for the Java(tm) platform
03: * ========================================================================
04: *
05: * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
06: *
07: * Project Info: http://www.jfree.org/jcommon/index.html
08: *
09: * This library is free software; you can redistribute it and/or modify it
10: * under the terms of the GNU Lesser General Public License as published by
11: * the Free Software Foundation; either version 2.1 of the License, or
12: * (at your option) any later version.
13: *
14: * This library is distributed in the hope that it will be useful, but
15: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17: * License for more details.
18: *
19: * You should have received a copy of the GNU Lesser General Public
20: * License along with this library; if not, write to the Free Software
21: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22: * USA.
23: *
24: * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
25: * in the United States and other countries.]
26: *
27: * --------------
28: * LogTarget.java
29: * --------------
30: * (C)opyright 2002-2004, by Object Refinery Limited.
31: *
32: * $Id: LogTarget.java,v 1.3 2005/11/14 10:55:59 mungady Exp $
33: *
34: * Changes
35: * -------
36: * 11-May-2002 : Initial version
37: * 06-Dec-2002 : LogTargets now use Object-Parameters instead of Strings.
38: * 05-Feb-2003 : Removed unnecessary methods.
39: * 29-Apr-2003 : Distilled from the JFreeReport project and moved into JCommon
40: *
41: */
42:
43: package org.jfree.util;
44:
45: /**
46: * An interface that defines a log target (a consumer of log messages). Classes which
47: * implement this interface can be registered with the {@link org.jfree.util.Log} class
48: * and will then receive logging messages generated by the code.
49: *
50: * @author Thomas Morgner
51: */
52: public interface LogTarget {
53:
54: /**
55: * Loglevel ERROR.
56: */
57: public static final int ERROR = 0;
58:
59: /**
60: * Loglevel WARN.
61: */
62: public static final int WARN = 1;
63:
64: /**
65: * Loglevel INFO.
66: */
67: public static final int INFO = 2;
68:
69: /**
70: * Loglevel DEBUG.
71: */
72: public static final int DEBUG = 3;
73:
74: /** Strings for the log levels. */
75: public static final String[] LEVELS = { "ERROR: ", "WARN: ",
76: "INFO: ", "DEBUG: " };
77:
78: /**
79: * Logs a message at a specified log level.
80: *
81: * @param level the log level.
82: * @param message the log message.
83: */
84: public void log(int level, Object message);
85:
86: /**
87: * Logs a message at a specified log level.
88: *
89: * @param level the log level.
90: * @param message the log message.
91: * @param e the exception
92: */
93: public void log(int level, Object message, Exception e);
94: }
|