org.lexevs.logging
Class Logger

java.lang.Object
  extended by org.lexevs.logging.Logger
All Implemented Interfaces:
java.io.Serializable, LgLoggerIF, LgMessageDirectorIF

public class Logger
extends java.lang.Object
implements LgLoggerIF, java.io.Serializable

All Log message from LexBIG methods should go through this class. This wraps log4j, and assigns unique identifiers for the log messages.

Version:
subversion $Revision: $ checked in on $Date: $
Author:
Dan Armbrust, Konrad Rokicki, Jesse Erdmann
See Also:
Serialized Form

Constructor Summary
Logger()
          Instantiates a new logger.
 
Method Summary
 void busy()
          Output to indicate system is busy - spin a cursor, print a dot, etc.
 java.lang.String debug(java.lang.String debugMessage)
          Take a debug message.
 java.lang.String debug(java.lang.String debugMessage, java.lang.Throwable cause)
          Debug.
 java.lang.String error(java.lang.String errorMessage)
          Display a non-fatal error to the user.
 java.lang.String error(java.lang.String errorMessage, java.lang.Throwable cause)
          Display a non-fatal error to the user
 void exportLogDebug(java.lang.String message)
           
 void exportLogError(java.lang.String message)
           
 void exportLogError(java.lang.String message, java.lang.Throwable e)
           
 void exportLogWarn(java.lang.String message, java.lang.Throwable e)
           
 java.lang.String fatal(java.lang.String errorMessage)
          Display a fatal error to the user.
 java.lang.String fatal(java.lang.String errorMessage, java.lang.Throwable cause)
          Display a fatal error to the user.
 void fatalAndThrowException(java.lang.String message)
          Display a fatal error to the user - and then throw an exception.
 void fatalAndThrowException(java.lang.String message, java.lang.Throwable sourceException)
          Display a fatal error to the user - and then throw an exception.
 void finishLogConfig(SystemVariables vars)
          Finish log config.
 java.lang.String info(java.lang.String infoMessage)
          Displays a status type of message (not an error or a warning)
 java.lang.String info(java.lang.String infoMessage, java.lang.Throwable cause)
          Info.
 boolean isAPILoggingEnabled()
          Checks if is aPI logging enabled.
 boolean isDebugEnabled()
          Checks if is debug enabled.
 void loadLogDebug(java.lang.String message)
           
 void loadLogError(java.lang.String message)
           
 void loadLogError(java.lang.String message, java.lang.Throwable e)
           
 void loadLogWarn(java.lang.String message, java.lang.Throwable e)
           
 void logMethod()
           
 void logMethod(java.lang.Object[] params)
           
 void setAPILoggingEnabled(boolean isAPILoggingEnabled)
          Sets the aPI logging enabled.
 void setDebugEnabled(boolean isDebugEnabled)
          Sets the debug enabled.
 void sysErrLogQueue()
          Sys err log queue.
 java.lang.String warn(java.lang.String warning)
          Display a warning to the user.
 java.lang.String warn(java.lang.String warning, java.lang.Throwable cause)
          Display a warning to the user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Logger

public Logger()
Instantiates a new logger.

Method Detail

finishLogConfig

public void finishLogConfig(SystemVariables vars)
Finish log config.

Parameters:
vars - the vars

debug

public java.lang.String debug(java.lang.String debugMessage)
Description copied from interface: LgMessageDirectorIF
Take a debug message.

Specified by:
debug in interface LgMessageDirectorIF
Returns:
Implementations may return a string, such as a log id.

debug

public java.lang.String debug(java.lang.String debugMessage,
                              java.lang.Throwable cause)
Debug.

Parameters:
debugMessage - the debug message
cause - the cause
Returns:
the string

info

public java.lang.String info(java.lang.String infoMessage)
Description copied from interface: LgMessageDirectorIF
Displays a status type of message (not an error or a warning)

Specified by:
info in interface LgMessageDirectorIF
Returns:
Implementations may return a string, such as a log id.

info

public java.lang.String info(java.lang.String infoMessage,
                             java.lang.Throwable cause)
Info.

Parameters:
infoMessage - the info message
cause - the cause
Returns:
the string

warn

public java.lang.String warn(java.lang.String warning)
Description copied from interface: LgMessageDirectorIF
Display a warning to the user.

Specified by:
warn in interface LgMessageDirectorIF
Returns:
Implementations may return a string, such as a log id.

warn

public java.lang.String warn(java.lang.String warning,
                             java.lang.Throwable cause)
Description copied from interface: LgMessageDirectorIF
Display a warning to the user

Specified by:
warn in interface LgMessageDirectorIF
cause - The source exception that caused the warning
Returns:
Implementations may return a string, such as a log id.

error

public java.lang.String error(java.lang.String errorMessage)
Description copied from interface: LgMessageDirectorIF
Display a non-fatal error to the user.

Specified by:
error in interface LgMessageDirectorIF
Returns:
Implementations may return a string, such as a log id.

error

public java.lang.String error(java.lang.String errorMessage,
                              java.lang.Throwable cause)
Description copied from interface: LgMessageDirectorIF
Display a non-fatal error to the user

Specified by:
error in interface LgMessageDirectorIF
cause - The source exception that caused the error.

fatal

public java.lang.String fatal(java.lang.String errorMessage)
Description copied from interface: LgMessageDirectorIF
Display a fatal error to the user.

Specified by:
fatal in interface LgMessageDirectorIF
Returns:
Implementations may return a string, such as a log id.

fatal

public java.lang.String fatal(java.lang.String errorMessage,
                              java.lang.Throwable cause)
Description copied from interface: LgMessageDirectorIF
Display a fatal error to the user.

Specified by:
fatal in interface LgMessageDirectorIF
cause - The source exception that caused the error.
Returns:
Implementations may return a string, such as a log id.

loadLogDebug

public void loadLogDebug(java.lang.String message)
Specified by:
loadLogDebug in interface LgLoggerIF

exportLogDebug

public void exportLogDebug(java.lang.String message)
Specified by:
exportLogDebug in interface LgLoggerIF

logMethod

public void logMethod()
Specified by:
logMethod in interface LgLoggerIF

logMethod

public void logMethod(java.lang.Object[] params)
Specified by:
logMethod in interface LgLoggerIF

exportLogError

public void exportLogError(java.lang.String message,
                           java.lang.Throwable e)
Specified by:
exportLogError in interface LgLoggerIF

exportLogError

public void exportLogError(java.lang.String message)
Specified by:
exportLogError in interface LgLoggerIF

exportLogWarn

public void exportLogWarn(java.lang.String message,
                          java.lang.Throwable e)
Specified by:
exportLogWarn in interface LgLoggerIF

loadLogError

public void loadLogError(java.lang.String message,
                         java.lang.Throwable e)
Specified by:
loadLogError in interface LgLoggerIF

loadLogError

public void loadLogError(java.lang.String message)
Specified by:
loadLogError in interface LgLoggerIF

loadLogWarn

public void loadLogWarn(java.lang.String message,
                        java.lang.Throwable e)
Specified by:
loadLogWarn in interface LgLoggerIF

sysErrLogQueue

public void sysErrLogQueue()
Sys err log queue.


busy

public void busy()
Description copied from interface: LgMessageDirectorIF
Output to indicate system is busy - spin a cursor, print a dot, etc.

Specified by:
busy in interface LgMessageDirectorIF

fatalAndThrowException

public void fatalAndThrowException(java.lang.String message)
                            throws java.lang.Exception
Description copied from interface: LgMessageDirectorIF
Display a fatal error to the user - and then throw an exception.

Specified by:
fatalAndThrowException in interface LgMessageDirectorIF
Throws:
java.lang.Exception

fatalAndThrowException

public void fatalAndThrowException(java.lang.String message,
                                   java.lang.Throwable sourceException)
                            throws java.lang.Exception
Description copied from interface: LgMessageDirectorIF
Display a fatal error to the user - and then throw an exception.

Specified by:
fatalAndThrowException in interface LgMessageDirectorIF
sourceException - The source exception that caused the error.
Throws:
java.lang.Exception

isAPILoggingEnabled

public boolean isAPILoggingEnabled()
Checks if is aPI logging enabled.

Returns:
true, if is aPI logging enabled

setAPILoggingEnabled

public void setAPILoggingEnabled(boolean isAPILoggingEnabled)
Sets the aPI logging enabled.

Parameters:
isAPILoggingEnabled - the new aPI logging enabled

isDebugEnabled

public boolean isDebugEnabled()
Checks if is debug enabled.

Returns:
true, if is debug enabled

setDebugEnabled

public void setDebugEnabled(boolean isDebugEnabled)
Sets the debug enabled.

Parameters:
isDebugEnabled - the new debug enabled

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.