ami
Class AMILog

java.lang.Object
  |
  +--ami.AMILog

public class AMILog
extends Object

Manages message logging with Log4J

Singleton

Version:
1.0
Author:
Bertrand Florat

Field Summary
private static AMILog al
          Self instance used for signleton pattern
static int DEBUG
           
static int ERROR
           
static int FATAL
           
static int INFO
           
static String LOG_PATTERN
          Logging pattern
private static Logger loggerPersistent
          logger for persistent events ( output in a file )
private static Logger loggerTemp
          logger for non-persistant events ( output on console)
private static String sLogFile
           
private static int verbosity
          Verbosity level of the logger( between 1 and 5 ) Default used at statup is INFO
static int WARNING
           
 
Constructor Summary
(package private) AMILog(String sAmiPath)
          Constructor for the AMILog object
 
Method Summary
static void debug(String s)
          Log a debug-level message
static void error(String s)
          Log an error-level message
static void fatal(String s)
          Log a fatal error message
static AMILog getInstance(String sAmiPath)
          Return a self instance
 int getVerbosity()
          Returns the verbosity.
static void info(String s)
          Log a info-level message
static void setVerbosity(int newVerbosity)
          Sets the verbosity.
static void stack(Exception e)
          Convenient method to display stacks properly
static void warn(String s)
          Log a warning-level message
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

sLogFile

private static String sLogFile

LOG_PATTERN

public static final String LOG_PATTERN
Logging pattern

loggerTemp

private static Logger loggerTemp
logger for non-persistant events ( output on console)

loggerPersistent

private static Logger loggerPersistent
logger for persistent events ( output in a file )

FATAL

public static final int FATAL

ERROR

public static final int ERROR

WARNING

public static final int WARNING

INFO

public static final int INFO

DEBUG

public static final int DEBUG

verbosity

private static int verbosity
Verbosity level of the logger( between 1 and 5 )

Default used at statup is INFO


al

private static AMILog al
Self instance used for signleton pattern
Constructor Detail

AMILog

AMILog(String sAmiPath)
Constructor for the AMILog object
Parameters:
sAmiPath - Description of Parameter
Method Detail

getInstance

public static AMILog getInstance(String sAmiPath)
Return a self instance
Parameters:
sAmiPath - Path to AMI logger file

Implementation of the singleton pattern


debug

public static void debug(String s)
Log a debug-level message

info

public static void info(String s)
Log a info-level message

warn

public static void warn(String s)
Log a warning-level message

error

public static void error(String s)
Log an error-level message

fatal

public static void fatal(String s)
Log a fatal error message

getVerbosity

public int getVerbosity()
Returns the verbosity.
Returns:
int

setVerbosity

public static void setVerbosity(int newVerbosity)
Sets the verbosity.
Parameters:
verbosity - The verbosity to set

stack

public static void stack(Exception e)
Convenient method to display stacks properly