uk.ac.ic.doc.automed.util
Class Logger

java.lang.Object
  extended by uk.ac.ic.doc.automed.util.Logger

public class Logger
extends java.lang.Object

Author:
Charis, Duc M Le

Field Summary
private  LogOutputHandler _loh
           
private static java.lang.String DEBUG
           
private static java.lang.String EMPTY
           
private static java.lang.String ERROR
           
private static java.util.Map loggers
           
private static LogOutputHandler loh
           
 
Constructor Summary
private Logger(LogOutputHandler loh)
           
 
Method Summary
static void debug(java.lang.Class cls, java.lang.String method, java.lang.String info)
          Overloading method to display more information about a debug message
static void debug(java.lang.Class cls, java.lang.String method, java.lang.String info, int debugSection, int debugLevel)
          Use this for a short-cut to invoking debug
static void debug(java.lang.Object object)
           
static void debug(java.lang.String info)
           
static void debug(java.lang.String className, java.lang.String method, java.lang.String info)
          Overloading method to display more information about a debug message
static void debug(java.lang.String className, java.lang.String method, java.lang.String info, int debugSection, int debugLevel)
          Use this for a short-cut to invoking debug
static void debug(java.lang.String loggerName, java.lang.String className, java.lang.String method, java.lang.String info)
           
static void debugAll(java.lang.String all)
          Use this method ONLY when the debug level is DEBUG_ALL
static void debugDetailed(java.lang.String msg)
          Invoke this method ONLY when debug level isi DEBUG_DETAILED
static void debugError(java.lang.String err)
          Use this method ONLY when the debug level is DEBUG_ERROR
static void debugInfo(java.lang.String msg)
          Invoke this method ONLY when debug level is DEBUG_INFO
static void error(java.lang.String error)
           
static void error(java.lang.String className, java.lang.String method, java.lang.String errMsg, java.lang.Throwable t)
           
static void error(java.lang.String error, java.lang.Throwable t)
           
static void error(java.lang.Throwable t)
           
static java.io.PrintStream getConsole()
           
static java.lang.String getLogMessage(java.lang.String loggerName)
          Used for memory log only
protected  LogOutputHandler getOutputHandler()
           
static void info(java.lang.Class cls, java.lang.String method, java.lang.String info)
          Overloading method to display more information about a message
static void info(java.lang.String info)
           
static boolean isRemoteLogging()
          Check if remote logging is set
static void newLogInstance(java.lang.String name, int handlerType, boolean append)
           
static void setConsole(java.io.PrintStream ps)
           
static void setOutputHandler(LogOutputHandler handler)
          Change default log handler
static void warn(java.lang.String warning)
           
private static void writeErrorLog(java.lang.String[] elements, java.lang.Throwable t)
           
private static void writeLog(LogOutputHandler lh, java.lang.String[] elements)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_loh

private LogOutputHandler _loh

EMPTY

private static final java.lang.String EMPTY
See Also:
Constant Field Values

DEBUG

private static final java.lang.String DEBUG
See Also:
Constant Field Values

ERROR

private static final java.lang.String ERROR
See Also:
Constant Field Values

loggers

private static java.util.Map loggers

loh

private static LogOutputHandler loh
Constructor Detail

Logger

private Logger(LogOutputHandler loh)
Method Detail

getOutputHandler

protected LogOutputHandler getOutputHandler()

getLogMessage

public static java.lang.String getLogMessage(java.lang.String loggerName)
Used for memory log only


info

public static void info(java.lang.String info)

info

public static void info(java.lang.Class cls,
                        java.lang.String method,
                        java.lang.String info)
Overloading method to display more information about a message


warn

public static void warn(java.lang.String warning)

error

public static void error(java.lang.String error)

error

public static void error(java.lang.String error,
                         java.lang.Throwable t)

error

public static void error(java.lang.Throwable t)

error

public static void error(java.lang.String className,
                         java.lang.String method,
                         java.lang.String errMsg,
                         java.lang.Throwable t)

debugInfo

public static void debugInfo(java.lang.String msg)
Invoke this method ONLY when debug level is DEBUG_INFO


debugDetailed

public static void debugDetailed(java.lang.String msg)
Invoke this method ONLY when debug level isi DEBUG_DETAILED

Parameters:
msg -

debugError

public static void debugError(java.lang.String err)
Use this method ONLY when the debug level is DEBUG_ERROR

Parameters:
err -

debugAll

public static void debugAll(java.lang.String all)
Use this method ONLY when the debug level is DEBUG_ALL

Parameters:
all -

debug

public static void debug(java.lang.String info)

debug

public static void debug(java.lang.Object object)

debug

public static void debug(java.lang.Class cls,
                         java.lang.String method,
                         java.lang.String info)
Overloading method to display more information about a debug message


debug

public static void debug(java.lang.Class cls,
                         java.lang.String method,
                         java.lang.String info,
                         int debugSection,
                         int debugLevel)
Use this for a short-cut to invoking debug


debug

public static void debug(java.lang.String className,
                         java.lang.String method,
                         java.lang.String info)
Overloading method to display more information about a debug message


debug

public static void debug(java.lang.String loggerName,
                         java.lang.String className,
                         java.lang.String method,
                         java.lang.String info)

debug

public static void debug(java.lang.String className,
                         java.lang.String method,
                         java.lang.String info,
                         int debugSection,
                         int debugLevel)
Use this for a short-cut to invoking debug


setOutputHandler

public static void setOutputHandler(LogOutputHandler handler)
Change default log handler


setConsole

public static void setConsole(java.io.PrintStream ps)

getConsole

public static java.io.PrintStream getConsole()

writeLog

private static void writeLog(LogOutputHandler lh,
                             java.lang.String[] elements)

writeErrorLog

private static void writeErrorLog(java.lang.String[] elements,
                                  java.lang.Throwable t)

isRemoteLogging

public static boolean isRemoteLogging()
Check if remote logging is set


newLogInstance

public static void newLogInstance(java.lang.String name,
                                  int handlerType,
                                  boolean append)