All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ow2.util.log.Log Maven / Gradle / Ivy

There is a newer version: 1.0.37
Show newest version
/**
 * EasyBeans
 * Copyright (C) 2007 Bull S.A.S.
 * Contact: [email protected]
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * --------------------------------------------------------------------------
 * $Id:JLog.java 1465 2007-06-07 16:38:37Z benoitf $
 * --------------------------------------------------------------------------
 */

package org.ow2.util.log;

import java.io.Serializable;

import org.ow2.util.i18n.I18n;

/**
 * Interface used for the logging.
* This don't use directly commons logging as the aim of this logging is to * provide internationalization abilities and to allow to use MessageFormat * message with an array of objects. * @author Florent Benoit */ public interface Log extends Serializable { /** *

* Is debug logging currently enabled? *

*

* Call this method to prevent having to perform expensive operations (for * example, String concatenation) when the log level is more * than debug. *

* @return true if it is enabled, else false */ boolean isDebugEnabled(); /** *

* Is error logging currently enabled? *

*

* Call this method to prevent having to perform expensive operations (for * example, String concatenation) when the log level is more * than error. *

* @return true if it is enabled, else false */ boolean isErrorEnabled(); /** *

* Is fatal logging currently enabled? *

*

* Call this method to prevent having to perform expensive operations (for * example, String concatenation) when the log level is more * than fatal. *

* @return true if it is enabled, else false */ boolean isFatalEnabled(); /** *

* Is info logging currently enabled? *

*

* Call this method to prevent having to perform expensive operations (for * example, String concatenation) when the log level is more * than info. *

* @return true if it is enabled, else false */ boolean isInfoEnabled(); /** *

* Is trace logging currently enabled? *

*

* Call this method to prevent having to perform expensive operations (for * example, String concatenation) when the log level is more * than trace. *

* @return true if it is enabled, else false */ boolean isTraceEnabled(); /** *

* Is warn logging currently enabled? *

*

* Call this method to prevent having to perform expensive operations (for * example, String concatenation) when the log level is more * than warn. *

* @return true if it is enabled, else false */ boolean isWarnEnabled(); /** *

* Log a message with trace log level. *

* @param message - This could be *
    *
  • an entry of an I18n repository
  • *
  • a preformated message given to MessageFormat class
  • *
  • or a simple object on which toString() method will be called
  • *
* @param args could be empty or contains the object for the formatter (I18n * case). To log an exception, the exception must be the last * argument. */ void trace(final Object message, final Object... args); /** *

* Log a message with debug log level. *

* @param message - This could be *
    *
  • an entry of an I18n repository
  • *
  • a preformated message given to MessageFormat class
  • *
  • or a simple object on which toString() method will be called
  • *
* @param args could be empty or contains the object for the formatter (I18n * case). To log an exception, the exception must be the last * argument. */ void debug(final Object message, final Object... args); /** *

* Log a message with info log level. *

* @param message - This could be *
    *
  • an entry of an I18n repository
  • *
  • a preformated message given to MessageFormat class
  • *
  • or a simple object on which toString() method will be called
  • *
* @param args could be empty or contains the object for the formatter (I18n * case). To log an exception, the exception must be the last * argument. */ void info(final Object message, final Object... args); /** *

* Log a message with warn log level. *

* @param message - This could be *
    *
  • an entry of an I18n repository
  • *
  • a preformated message given to MessageFormat class
  • *
  • or a simple object on which toString() method will be called
  • *
* @param args could be empty or contains the object for the formatter (I18n * case). To log an exception, the exception must be the last * argument. */ void warn(final Object message, final Object... args); /** *

* Log a message with error log level. *

* @param message - This could be *
    *
  • an entry of an I18n repository
  • *
  • a preformated message given to MessageFormat class
  • *
  • or a simple object on which toString() method will be called
  • *
* @param args could be empty or contains the object for the formatter (I18n * case). To log an exception, the exception must be the last * argument. */ void error(final Object message, final Object... args); /** *

* Log a message with fatal log level. *

* @param message - This could be *
    *
  • an entry of an I18n repository
  • *
  • a preformated message given to MessageFormat class
  • *
  • or a simple object on which toString() method will be called
  • *
* @param args could be empty or contains the object for the formatter (I18n * case). To log an exception, the exception must be the last * argument. */ void fatal(final Object message, final Object... args); /** * Gets the i18n object associated to this logger. * @return i18n object. */ I18n getI18n(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy