public abstract class Logger extends Object implements RevisionHandler
Modifier and Type | Class and Description |
---|---|
static class |
Logger.Level
The logging level.
|
Modifier and Type | Field and Description |
---|---|
protected static SimpleDateFormat |
m_DateFormat
for formatting the dates.
|
protected Logger.Level |
m_MinLevel
the minimum level of log events to have in order to end up in the log.
|
protected static Properties |
m_Properties
the properties file.
|
protected static Logger |
m_Singleton
the singleton instance of the logger.
|
static String |
PROPERTIES_FILE
the properties file.
|
Constructor and Description |
---|
Logger()
Initializes the logger.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doLog(Logger.Level level,
String msg,
String cls,
String method,
int lineno)
Performs the actual logging.
|
protected static String[] |
getLocation()
Returns the location the logging happened.
|
Logger.Level |
getMinLevel()
Returns the minimum level log messages must have in order to appear in
the log.
|
static Logger |
getSingleton()
Returns the singleton instance of the logger.
|
protected void |
initialize()
Initializes the logger.
|
static void |
log(Logger.Level level,
String msg)
Logs the given message under the given level.
|
static void |
log(Logger.Level level,
Throwable t)
Logs the given message under the given level.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRevision
public static final String PROPERTIES_FILE
protected Logger.Level m_MinLevel
protected static Logger m_Singleton
protected static Properties m_Properties
protected static SimpleDateFormat m_DateFormat
protected void initialize()
public Logger.Level getMinLevel()
protected static String[] getLocation()
protected abstract void doLog(Logger.Level level, String msg, String cls, String method, int lineno)
level
- the level of the messagemsg
- the message to logcls
- the classname originating the log eventmethod
- the method originating the log eventlineno
- the line number originating the log eventpublic static Logger getSingleton()
public static void log(Logger.Level level, String msg)
level
- the level of the messagemsg
- the message to logpublic static void log(Logger.Level level, Throwable t)
level
- the level of the messaget
- the throwable to logCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.