com.amx.duet.tools.lang
Class Logger

java.lang.Object
  extended bycom.amx.duet.tools.lang.Logger

public class Logger
extends java.lang.Object

This class can be used for writing out diagnostic and error messages to the output stream. A wrapper for that “System.out.println()” method that formats the output with the name of the originating class.

Version:
1.0.0

Field Summary
static int LOG_DEBUG
          Similar the Service.DEBUG
static int LOG_ERROR
          Similar the Service.ERROR
static int LOG_INFO
          Similar the Service.INFO
static int LOG_WARNING
          Similar the Service.WARNING
 
Constructor Summary
Logger()
           
 
Method Summary
 void debug(java.lang.String str)
          This will only display messages if debugging is enabled with the enableDebug() method
static void diag(java.lang.Class cls, java.lang.String str)
          Use this to display diagnostic messages, if you are not extending Diag
static void diag(java.lang.Object obj, java.lang.String str)
          Use this to display diagnostic messages, if you are not extending Diag
 void diag(java.lang.String str)
          Use this to display diagnostic messages, if you are extending Diag
static void diag(java.lang.String sClassName, java.lang.String str)
          Use this to display diagnostic messages, if you are not extending Diag
 void enableDebug(boolean bState)
          Enable debug messages to be displayed by setting the debug state flag.
static void error(java.lang.Class cls, java.lang.String str)
          Use this to display error messages, if you are not extending Diag
static void error(java.lang.Object obj, java.lang.String str)
          Use this to display error messages, if you are not extending Diag
 void error(java.lang.String str)
          Use this to display error messages, if you are extending Diag
static void error(java.lang.String sClassName, java.lang.String str)
          Use this to display error messages, if you are not extending Diag
 boolean isDebugEnabled()
          Check to see if the debug state flag has been set to true or false.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_DEBUG

public static final int LOG_DEBUG
Similar the Service.DEBUG

See Also:
Constant Field Values

LOG_INFO

public static final int LOG_INFO
Similar the Service.INFO

See Also:
Constant Field Values

LOG_WARNING

public static final int LOG_WARNING
Similar the Service.WARNING

See Also:
Constant Field Values

LOG_ERROR

public static final int LOG_ERROR
Similar the Service.ERROR

See Also:
Constant Field Values
Constructor Detail

Logger

public Logger()
Method Detail

diag

public static final void diag(java.lang.Object obj,
                              java.lang.String str)
Use this to display diagnostic messages, if you are not extending Diag

Parameters:
obj - method caller (usually the this member)
str - data to be displayed

diag

public static final void diag(java.lang.Class cls,
                              java.lang.String str)
Use this to display diagnostic messages, if you are not extending Diag

Parameters:
cls - Class calling the method (usually the .class member)
str - data to be displayed

diag

public static final void diag(java.lang.String sClassName,
                              java.lang.String str)
Use this to display diagnostic messages, if you are not extending Diag

Parameters:
sClassName - name of the class to prepend to log message
str - data to be displayed

error

public static final void error(java.lang.Object obj,
                               java.lang.String str)
Use this to display error messages, if you are not extending Diag

Parameters:
obj - method caller (usually the this member)
str - data to be displayed

error

public static final void error(java.lang.Class cls,
                               java.lang.String str)
Use this to display error messages, if you are not extending Diag

Parameters:
cls - Class calling the method (usually the .class member)
str - data to be displayed

error

public static final void error(java.lang.String sClassName,
                               java.lang.String str)
Use this to display error messages, if you are not extending Diag

Parameters:
sClassName - name of the class to prepend to error message
str - data to be displayed

diag

public void diag(java.lang.String str)
Use this to display diagnostic messages, if you are extending Diag

Parameters:
str - data to be displayed

error

public void error(java.lang.String str)
Use this to display error messages, if you are extending Diag

Parameters:
str - data to be displayed

debug

public void debug(java.lang.String str)
This will only display messages if debugging is enabled with the enableDebug() method

Parameters:
str - str data to be displayed

enableDebug

public final void enableDebug(boolean bState)
Enable debug messages to be displayed by setting the debug state flag. Can also be used by derived classes as an internal debug state flag.

Parameters:
bState - true if debugging should be enable; false otherwise.

isDebugEnabled

public final boolean isDebugEnabled()
Check to see if the debug state flag has been set to true or false.

Returns:
true if debugging is enabled; false otherwise.


Copyright © 2008 AMX LLC. All Rights Reserved.