gnu.hylafax.logging
Class ConsoleLogger

java.lang.Object
  |
  +--gnu.hylafax.logging.ConsoleLogger
All Implemented Interfaces:
Logger

public class ConsoleLogger
extends java.lang.Object
implements Logger

Implements the console logger for gnu.hylafax.logging.LoggingFactory. All logging for this class is sent to System.out by default. It is possible to change the PrintStream / OutputStream of the logger by calling setOutputStream(OutputStream out). This feature has not been tested and is not even recommended because if an OutputStream is needed other than System.out, log4j should be used. log4j can be found at http://logging.apache.org

Author:
Steven Jardine

Field Summary
static java.lang.String DEBUG_TYPE
          Specify the DEBUG_TYPE for logging.
static java.lang.String ERROR_TYPE
          Specify the ERROR_TYPE for logging.
static java.lang.String FATAL_TYPE
          Specify the FATAL_TYPE for logging.
static java.lang.String INFO_TYPE
          Specify the INFO_TYPE for logging.
static java.lang.String WARN_TYPE
          Specify the WARN_TYPE for logging.
 
Constructor Summary
ConsoleLogger(java.lang.Class logClass)
          Sets the class name for the logger.
ConsoleLogger(java.lang.String className)
          Sets the class name for the logger.
 
Method Summary
 void debug(java.lang.Object message)
          Log a debug message.
 void debug(java.lang.Object message, java.lang.Throwable t)
          Log a debug message with an exception.
 void error(java.lang.Object message)
          Log an error message.
 void error(java.lang.Object message, java.lang.Throwable t)
          Log an error message with an exception.
 void fatal(java.lang.Object message)
          Log a fatal message.
 void fatal(java.lang.Object message, java.lang.Throwable t)
          Log a fatal message with an exception.
 void info(java.lang.Object message)
          Log an info message.
 void info(java.lang.Object message, java.lang.Throwable t)
          Log an info message with an exception.
 boolean isDebugEnabled()
           
 boolean isErrorEnabled()
           
 boolean isFatalEnabled()
           
 boolean isInfoEnabled()
           
 boolean isWarnEnabled()
           
 void setDebugEnabled(boolean debugEnabled)
          Sets the ConsoleLogger to show debug messages.
 void setErrorEnabled(boolean errorEnabled)
          Sets the ConsoleLogger to show error messages.
 void setFatalEnabled(boolean fatalEnabled)
          Sets the ConsoleLogger to show fatal messages.
 void setInfoEnabled(boolean infoEnabled)
          Sets the ConsoleLogger to show info messages.
 void setOutputStream(java.io.OutputStream out)
          Sets the java.io.OutputStream for the console logger.
 void setWarnEnabled(boolean warnEnabled)
          Sets the ConsoleLogger to show warn messages.
 void warn(java.lang.Object message)
          Log a warn message.
 void warn(java.lang.Object message, java.lang.Throwable t)
          Log a warn message with an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_TYPE

public static final java.lang.String DEBUG_TYPE
Specify the DEBUG_TYPE for logging.

ERROR_TYPE

public static final java.lang.String ERROR_TYPE
Specify the ERROR_TYPE for logging.

FATAL_TYPE

public static final java.lang.String FATAL_TYPE
Specify the FATAL_TYPE for logging.

INFO_TYPE

public static final java.lang.String INFO_TYPE
Specify the INFO_TYPE for logging.

WARN_TYPE

public static final java.lang.String WARN_TYPE
Specify the WARN_TYPE for logging.
Constructor Detail

ConsoleLogger

public ConsoleLogger(java.lang.Class logClass)
Sets the class name for the logger.
Parameters:
logClass - The class to use for logging.

ConsoleLogger

public ConsoleLogger(java.lang.String className)
Sets the class name for the logger.
Parameters:
className - The name of the class to use for logging.
Method Detail

debug

public void debug(java.lang.Object message)
Description copied from interface: Logger
Log a debug message.
Specified by:
debug in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Parameters:
message -  

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable t)
Description copied from interface: Logger
Log a debug message with an exception.
Specified by:
debug in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Parameters:
message -  
t -  

error

public void error(java.lang.Object message)
Description copied from interface: Logger
Log an error message.
Specified by:
error in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Parameters:
message -  

error

public void error(java.lang.Object message,
                  java.lang.Throwable t)
Description copied from interface: Logger
Log an error message with an exception.
Specified by:
error in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Parameters:
message -  
t -  

fatal

public void fatal(java.lang.Object message)
Description copied from interface: Logger
Log a fatal message.
Specified by:
fatal in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Parameters:
message -  

fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable t)
Description copied from interface: Logger
Log a fatal message with an exception.
Specified by:
fatal in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Parameters:
message -  
t -  

info

public void info(java.lang.Object message)
Description copied from interface: Logger
Log an info message.
Specified by:
info in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Parameters:
message -  

info

public void info(java.lang.Object message,
                 java.lang.Throwable t)
Description copied from interface: Logger
Log an info message with an exception.
Specified by:
info in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Parameters:
message -  
t -  

isDebugEnabled

public boolean isDebugEnabled()
Specified by:
isDebugEnabled in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Returns:
true is debug level is enabled.

isErrorEnabled

public boolean isErrorEnabled()
Specified by:
isErrorEnabled in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Returns:
true is error level is enabled.

isFatalEnabled

public boolean isFatalEnabled()
Specified by:
isFatalEnabled in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Returns:
true is fatal level is enabled.

isInfoEnabled

public boolean isInfoEnabled()
Specified by:
isInfoEnabled in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Returns:
true is info level is enabled.

isWarnEnabled

public boolean isWarnEnabled()
Specified by:
isWarnEnabled in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Returns:
true is warn level is enabled.

setDebugEnabled

public void setDebugEnabled(boolean debugEnabled)
Sets the ConsoleLogger to show debug messages.
Parameters:
debugEnabled -  

setErrorEnabled

public void setErrorEnabled(boolean errorEnabled)
Sets the ConsoleLogger to show error messages.
Parameters:
errorEnabled -  

setFatalEnabled

public void setFatalEnabled(boolean fatalEnabled)
Sets the ConsoleLogger to show fatal messages.
Parameters:
fatalEnabled -  

setInfoEnabled

public void setInfoEnabled(boolean infoEnabled)
Sets the ConsoleLogger to show info messages.
Parameters:
infoEnabled -  

setOutputStream

public void setOutputStream(java.io.OutputStream out)
Sets the java.io.OutputStream for the console logger.
Parameters:
out -  

setWarnEnabled

public void setWarnEnabled(boolean warnEnabled)
Sets the ConsoleLogger to show warn messages.
Parameters:
warnEnabled -  

warn

public void warn(java.lang.Object message)
Description copied from interface: Logger
Log a warn message.
Specified by:
warn in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Parameters:
message -  

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable t)
Description copied from interface: Logger
Log a warn message with an exception.
Specified by:
warn in interface Logger
Following copied from interface: gnu.hylafax.logging.Logger
Parameters:
message -  
t -