raccoon.core.log
Class LogConsole

java.lang.Object
  extended by raccoon.core.log.LogConsole
All Implemented Interfaces:
ILogger

public final class LogConsole
extends java.lang.Object
implements ILogger

The console logger.

Since:
Raccoon v1.0
Version:
$Id: LogConsole.java,v 1.1 2004/08/08 20:19:17 crouvrais Exp $
Author:
Cedric ROUVRAIS

Field Summary
 
Fields inherited from interface raccoon.api.log.ILogger
LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO, LEVEL_WARN, PTY_LOGGER
 
Constructor Summary
LogConsole()
           
 
Method Summary
 void debug(java.lang.String pMessage)
          Inserts a String into the log only if the DEBUG level is enabled.
 void debug(java.lang.String pMessage, java.lang.Object[] pParams)
          Inserts a String into the log only if the DEBUG level is enabled.
 void debug(java.lang.String pMessage, java.lang.Object[] pParams, java.lang.Throwable pThrowable)
          Inserts a String and an Exception into the log only if the DEBUG level is enabled.
 void debug(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Inserts a String and an Exception into the log only if the DEBUG level is enabled.
 void error(java.lang.String pMessage)
          Inserts a String into the log only if the ERROR level is enabled.
 void error(java.lang.String pMessage, java.lang.Object[] pParams)
          Inserts a String into the log only if the ERROR level is enabled.
 void error(java.lang.String pMessage, java.lang.Object[] pParams, java.lang.Throwable pThrowable)
          Inserts a String and an Exception into the log only if the ERROR level is enabled.
 void error(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Inserts a String and an Exception into the log only if the ERROR level is enabled.
 java.lang.String getCategoryName()
          Deprecated. As of Raccoon v0.8
 java.lang.String getLoggerName()
          The logger under which this component is logging the information.
 void info(java.lang.String pMessage)
          Inserts a String into the log only if the INFO level is enabled.
 void info(java.lang.String pMessage, java.lang.Object[] pParams)
          Inserts a String into the log only if the INFO level is enabled.
 void info(java.lang.String pMessage, java.lang.Object[] pParams, java.lang.Throwable pThrowable)
          Insert a String and an exception into the log only if the INFO level is enabled.
 void info(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Inserts a String and an Exception into the log only if the INFO level is enabled.
 boolean isDebugEnabled()
          Checks if debug mode is enabled.
 boolean isErrorEnabled()
          Checks if error mode is enabled.
 boolean isInfoEnabled()
          Checks if info mode is enabled.
 boolean isWarnEnabled()
          Checks if warn mode is enabled.
 void setCategoryName(java.lang.String pCategoryName)
          Deprecated. As of Raccoon v0.8
 void setLoggerName(java.lang.String pLoggerName)
          Defines the logger under which this component should log the information.
 void setLogLevel(int pLogLevel)
          Defines the log level that is active.
 void warn(java.lang.String pMessage)
          Inserts a String into the log only if the WARN level is enabled.
 void warn(java.lang.String pMessage, java.lang.Object[] pParams)
          Inserts a String into the log only if the WARN level is enabled.
 void warn(java.lang.String pMessage, java.lang.Object[] pParams, java.lang.Throwable pThrowable)
          Inserts a String and an Exception into the log only if the WARN level is enabled.
 void warn(java.lang.String pMessage, java.lang.Throwable pThrowable)
          Inserts a String and an Exception into the log only if the WARN level is enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogConsole

public LogConsole()
Method Detail

setLogLevel

public void setLogLevel(int pLogLevel)
Defines the log level that is active.

Parameters:
pLogLevel - the new log level.

isDebugEnabled

public boolean isDebugEnabled()
Checks if debug mode is enabled. Use this method to avoid unnecessary String construction when calling the debug method.

Specified by:
isDebugEnabled in interface ILogger
Returns:
will use of debug produce some logs?

isInfoEnabled

public boolean isInfoEnabled()
Checks if info mode is enabled. Use this method to avoid unnecessary String construction when calling the info method.

Specified by:
isInfoEnabled in interface ILogger
Returns:
true if info mode is enabled

isWarnEnabled

public boolean isWarnEnabled()
Checks if warn mode is enabled. Use this method to avoid unnecessary String construction when calling the warn method.

Specified by:
isWarnEnabled in interface ILogger
Returns:
true if warn mode is enabled

isErrorEnabled

public boolean isErrorEnabled()
Checks if error mode is enabled. Use this method to avoid unnecessary String construction when calling the error method.

Specified by:
isErrorEnabled in interface ILogger
Returns:
true if error mode is enabled

info

public void info(java.lang.String pMessage)
Inserts a String into the log only if the INFO level is enabled.

Specified by:
info in interface ILogger
Parameters:
pMessage - the message to log.

info

public void info(java.lang.String pMessage,
                 java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log only if the INFO level is enabled.

Specified by:
info in interface ILogger
Parameters:
pMessage - the message to log.
pThrowable - the throwable to log.

info

public void info(java.lang.String pMessage,
                 java.lang.Object[] pParams)
Inserts a String into the log only if the INFO level is enabled. The String is of course a specific String, because each occurrence of {i} in that String will be replaced by Object[i].toString()
For example:
info("Hello {0}, you have {1}, new Object[] {"Kathleen", "mail"});
Should result be equivalent to the following call:
info("Hello Kathleen, you have mail");
No matter what the implementation behind the scenes.

Specified by:
info in interface ILogger
Parameters:
pMessage - the message to log.
pParams - a list of objects that implement the toString() method.

info

public void info(java.lang.String pMessage,
                 java.lang.Object[] pParams,
                 java.lang.Throwable pThrowable)
Insert a String and an exception into the log only if the INFO level is enabled.

Specified by:
info in interface ILogger
Parameters:
pMessage - the message to log.
pParams - a list of objects that implement the toString() method.
pThrowable - the throwable to log.
See Also:
info(String, Object[])

debug

public void debug(java.lang.String pMessage)
Inserts a String into the log only if the DEBUG level is enabled.

Specified by:
debug in interface ILogger
Parameters:
pMessage - the message to log.

debug

public void debug(java.lang.String pMessage,
                  java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log only if the DEBUG level is enabled.

Specified by:
debug in interface ILogger
Parameters:
pMessage - the message to log.
pThrowable - the throwable to log.

debug

public void debug(java.lang.String pMessage,
                  java.lang.Object[] pParams)
Inserts a String into the log only if the DEBUG level is enabled.

Specified by:
debug in interface ILogger
Parameters:
pMessage - the message to log.
pParams - a list of objects that implement the toString() method.
See Also:
info(String, Object[])

debug

public void debug(java.lang.String pMessage,
                  java.lang.Object[] pParams,
                  java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log only if the DEBUG level is enabled.

Specified by:
debug in interface ILogger
Parameters:
pMessage - the message to log.
pParams - a list of objects that implement the toString() method.
pThrowable - the throwable to log.
See Also:
info(String, Object[], Throwable)

warn

public void warn(java.lang.String pMessage)
Inserts a String into the log only if the WARN level is enabled.

Specified by:
warn in interface ILogger
Parameters:
pMessage - the message to log.

warn

public void warn(java.lang.String pMessage,
                 java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log only if the WARN level is enabled.

Specified by:
warn in interface ILogger
Parameters:
pThrowable - the throwable to log.
pMessage - the message to log.

warn

public void warn(java.lang.String pMessage,
                 java.lang.Object[] pParams)
Inserts a String into the log only if the WARN level is enabled.

Specified by:
warn in interface ILogger
Parameters:
pMessage - the message to log.
pParams - a list of objects that implement the toString() method.
See Also:
info(String, Object[])

warn

public void warn(java.lang.String pMessage,
                 java.lang.Object[] pParams,
                 java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log only if the WARN level is enabled.

Specified by:
warn in interface ILogger
Parameters:
pMessage - the message to log.
pParams - a list of objects that implement the toString() method.
pThrowable - the throwable to log.
See Also:
info(String, Object[], Throwable)

error

public void error(java.lang.String pMessage)
Inserts a String into the log only if the ERROR level is enabled.

Specified by:
error in interface ILogger
Parameters:
pMessage - the message to log.

error

public void error(java.lang.String pMessage,
                  java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log only if the ERROR level is enabled.

Specified by:
error in interface ILogger
Parameters:
pThrowable - the throwable to log.
pMessage - the message to log.

error

public void error(java.lang.String pMessage,
                  java.lang.Object[] pParams)
Inserts a String into the log only if the ERROR level is enabled.

Specified by:
error in interface ILogger
Parameters:
pMessage - the message to log.
pParams - a list of objects that implement the toString() method.
See Also:
info(String, Object[])

error

public void error(java.lang.String pMessage,
                  java.lang.Object[] pParams,
                  java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log only if the ERROR level is enabled.

Specified by:
error in interface ILogger
Parameters:
pMessage - the message to log.
pParams - a list of objects that implement the toString() method.
pThrowable - the throwable to log.
See Also:
info(String, Object[], Throwable)

getCategoryName

public java.lang.String getCategoryName()
Deprecated. As of Raccoon v0.8

The category under which this component is logging the information.

Specified by:
getCategoryName in interface ILogger
Returns:
the category name of the current instance.

setCategoryName

public void setCategoryName(java.lang.String pCategoryName)
                     throws java.lang.IllegalStateException
Deprecated. As of Raccoon v0.8

Defines the category under which this component should log the information.

Specified by:
setCategoryName in interface ILogger
Parameters:
pCategoryName - the category to use for this session.
Throws:
java.lang.IllegalStateException - if the component is already running

getLoggerName

public java.lang.String getLoggerName()
The logger under which this component is logging the information.

Specified by:
getLoggerName in interface ILogger
Returns:
the logger name of the current instance.

setLoggerName

public void setLoggerName(java.lang.String pLoggerName)
                   throws java.lang.IllegalStateException
Defines the logger under which this component should log the information.

Specified by:
setLoggerName in interface ILogger
Parameters:
pLoggerName - the logger to use for this session.
Throws:
java.lang.IllegalStateException - if the component is already running


Copyright null null. All Rights Reserved.