org.objectweb.easybeans.log
Interface JLog

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
CommonsLoggerImpl, JDKLogger

public interface JLog
extends java.io.Serializable

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

Method Summary
 void debug(java.lang.Object message, java.lang.Object... args)
           Log a message with debug log level.
 void error(java.lang.Object message, java.lang.Object... args)
           Log a message with error log level.
 void fatal(java.lang.Object message, java.lang.Object... args)
           Log a message with fatal log level.
 I18n getI18n()
          Gets the i18n object associated to this logger.
 void info(java.lang.Object message, java.lang.Object... args)
           Log a message with info log level.
 boolean isDebugEnabled()
           Is debug logging currently enabled?
 boolean isErrorEnabled()
           Is error logging currently enabled?
 boolean isFatalEnabled()
           Is fatal logging currently enabled?
 boolean isInfoEnabled()
           Is info logging currently enabled?
 boolean isTraceEnabled()
           Is trace logging currently enabled?
 boolean isWarnEnabled()
           Is warn logging currently enabled?
 void trace(java.lang.Object message, java.lang.Object... args)
           Log a message with trace log level.
 void warn(java.lang.Object message, java.lang.Object... args)
           Log a message with warn log level.
 

Method Detail

isDebugEnabled

boolean isDebugEnabled()

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.

Returns:
true if it is enabled, else false

isErrorEnabled

boolean isErrorEnabled()

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.

Returns:
true if it is enabled, else false

isFatalEnabled

boolean isFatalEnabled()

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.

Returns:
true if it is enabled, else false

isInfoEnabled

boolean isInfoEnabled()

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.

Returns:
true if it is enabled, else false

isTraceEnabled

boolean isTraceEnabled()

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.

Returns:
true if it is enabled, else false

isWarnEnabled

boolean isWarnEnabled()

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.

Returns:
true if it is enabled, else false

trace

void trace(java.lang.Object message,
           java.lang.Object... args)

Log a message with trace log level.

Parameters:
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
args - could be empty or contains the object for the formatter (I18n case). To log an exception, the exception must be the last argument.

debug

void debug(java.lang.Object message,
           java.lang.Object... args)

Log a message with debug log level.

Parameters:
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
args - could be empty or contains the object for the formatter (I18n case). To log an exception, the exception must be the last argument.

info

void info(java.lang.Object message,
          java.lang.Object... args)

Log a message with info log level.

Parameters:
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
args - could be empty or contains the object for the formatter (I18n case). To log an exception, the exception must be the last argument.

warn

void warn(java.lang.Object message,
          java.lang.Object... args)

Log a message with warn log level.

Parameters:
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
args - could be empty or contains the object for the formatter (I18n case). To log an exception, the exception must be the last argument.

error

void error(java.lang.Object message,
           java.lang.Object... args)

Log a message with error log level.

Parameters:
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
args - could be empty or contains the object for the formatter (I18n case). To log an exception, the exception must be the last argument.

fatal

void fatal(java.lang.Object message,
           java.lang.Object... args)

Log a message with fatal log level.

Parameters:
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
args - could be empty or contains the object for the formatter (I18n case). To log an exception, the exception must be the last argument.

getI18n

I18n getI18n()
Gets the i18n object associated to this logger.

Returns:
i18n object.