Source for org.jfree.util.LogTarget

   1: /* ========================================================================
   2:  * JCommon : a free general purpose class library for the Java(tm) platform
   3:  * ========================================================================
   4:  *
   5:  * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
   6:  * 
   7:  * Project Info:  http://www.jfree.org/jcommon/index.html
   8:  *
   9:  * 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 =
  76:         {
  77:             "ERROR: ",
  78:             "WARN:  ",
  79:             "INFO:  ",
  80:             "DEBUG: "
  81:         };
  82: 
  83:     /**
  84:      * Logs a message at a specified log level.
  85:      *
  86:      * @param level  the log level.
  87:      * @param message  the log message.
  88:      */
  89:     public void log(int level, Object message);
  90: 
  91:     /**
  92:      * Logs a message at a specified log level.
  93:      *
  94:      * @param level  the log level.
  95:      * @param message  the log message.
  96:      * @param e  the exception
  97:      */
  98:     public void log(int level, Object message, Exception e);
  99: }