org.arakhne.logging
Interface Logger

All Known Implementing Classes:
AbstractLogger, AbstractPrintStreamLogger, AbstractStandAloneLogger, ConsoleLogger, FileLogger, SunLogger

public interface Logger

The main user interface to logging. This interface provides classic method use to log string or status at various level. These level are described in the LogLevel Enum;

Version:
1.7 (rev:285) 2011-10-14 12:02:59
Author:
Stéphane GALLAND, Nicolas GAUD
See Also:
LogLevel
Maven Group Id:
org.arakhne.afc
Maven Artifact Id:
arakhneLogger

Method Summary
 void addLoggerEventListener(LoggerEventListener listener)
          Add listener on logger events.
 void debug(Object source, String msg)
          Log a message at the DEBUG level.
 void debug(Object source, String msg, Throwable t)
          Log an exception (throwable) at the DEBUG level with an accompanying message.
 void error(Object source, String msg)
          Log a message at the ERROR level.
 void error(Object source, String msg, Throwable t)
          Log an exception (throwable) at the ERROR level with an accompanying message.
 LogLevel getLogLevel()
          Replies the minimum log level.
 String getName()
          Return the name of this Logger instance.
 void info(Object source, String msg)
          Log a message at the INFO level.
 void info(Object source, String msg, Throwable t)
          Log an exception (throwable) at the INFO level with an accompanying message.
 boolean isDebugEnabled()
          Is the logger instance enabled for the DEBUG level?
 boolean isErrorEnabled()
          Is the logger instance enabled for the ERROR level?
 boolean isInfoEnabled()
          Is the logger instance enabled for the INFO level?
 boolean isWarnEnabled()
          Is the logger instance enabled for the WARN level?
 void log(Object source, LogLevel level, String msg)
          Log the specified message at the specified level
 void log(Object source, LogLevel level, String msg, Throwable exception)
          Log the specified message at the specified level
 void removeLoggerEventListener(LoggerEventListener listener)
          Remove listener on logger events.
 void setLogLevel(LogLevel level)
          Set the minimum log level.
 void warn(Object source, String msg)
          Log a message at the WARN level.
 void warn(Object source, String msg, Throwable t)
          Log an exception (throwable) at the WARN level with an accompanying message.
 

Method Detail

getName

String getName()
Return the name of this Logger instance.

Returns:
the name of this Logger instance.

isDebugEnabled

boolean isDebugEnabled()
Is the logger instance enabled for the DEBUG level?

Returns:
true if this Logger is enabled for the DEBUG level, false otherwise.

log

void log(Object source,
         LogLevel level,
         String msg)
Log the specified message at the specified level

Parameters:
source - - the object which send this log
level - - the log level
msg - - the message to log
Since:
1.2

log

void log(Object source,
         LogLevel level,
         String msg,
         Throwable exception)
Log the specified message at the specified level

Parameters:
source - - the object which send this log
level - - the log level
msg - - the message to log
exception - - the exception cause of the log message
Since:
1.2

debug

void debug(Object source,
           String msg)
Log a message at the DEBUG level.

Parameters:
source - - the object which send this log
msg - the message string to be logged
Since:
1.2

debug

void debug(Object source,
           String msg,
           Throwable t)
Log an exception (throwable) at the DEBUG level with an accompanying message.

Parameters:
source - - the object which send this log
msg - the message accompanying the exception
t - the exception (throwable) to log
Since:
1.2

isInfoEnabled

boolean isInfoEnabled()
Is the logger instance enabled for the INFO level?

Returns:
true if this Logger is enabled for the INFO level, false otherwise.

info

void info(Object source,
          String msg)
Log a message at the INFO level.

Parameters:
source - - the object which send this log
msg - the message string to be logged
Since:
1.2

info

void info(Object source,
          String msg,
          Throwable t)
Log an exception (throwable) at the INFO level with an accompanying message.

Parameters:
source - - the object which send this log
msg - the message accompanying the exception
t - the exception (throwable) to log
Since:
1.2

isWarnEnabled

boolean isWarnEnabled()
Is the logger instance enabled for the WARN level?

Returns:
true if this Logger is enabled for the WARN level, false otherwise.

warn

void warn(Object source,
          String msg)
Log a message at the WARN level.

Parameters:
source - - the object which send this log
msg - the message string to be logged
Since:
1.2

warn

void warn(Object source,
          String msg,
          Throwable t)
Log an exception (throwable) at the WARN level with an accompanying message.

Parameters:
source - - the object which send this log
msg - the message accompanying the exception
t - the exception (throwable) to log
Since:
1.2

isErrorEnabled

boolean isErrorEnabled()
Is the logger instance enabled for the ERROR level?

Returns:
true if this Logger is enabled for the ERROR level, false otherwise.

error

void error(Object source,
           String msg)
Log a message at the ERROR level.

Parameters:
source - - the object which send this log
msg - the message string to be logged
Since:
1.2

error

void error(Object source,
           String msg,
           Throwable t)
Log an exception (throwable) at the ERROR level with an accompanying message.

Parameters:
source - - the object which send this log
msg - the message accompanying the exception
t - the exception (throwable) to log
Since:
1.2

setLogLevel

void setLogLevel(LogLevel level)
Set the minimum log level.

Parameters:
level -

getLogLevel

LogLevel getLogLevel()
Replies the minimum log level.

Returns:
the minimal log level

addLoggerEventListener

void addLoggerEventListener(LoggerEventListener listener)
Add listener on logger events.

Parameters:
listener -

removeLoggerEventListener

void removeLoggerEventListener(LoggerEventListener listener)
Remove listener on logger events.

Parameters:
listener -


Copyright © 2006-2011 Arakhnê.org Consortium. All rights reserved under LGPL license terms.