public final class DasLogger extends Object
Modifier and Type | Field and Description |
---|---|
private static String |
CLASS
Name of this class.
|
private static String |
CONFIG_ENTRY
Formatter string for building configuration entry for log.
|
private static String |
FILE_NAME
Log file name das.log.
|
private static String |
GET_INFORMATION_TEMPLATE
Test information (a la toString) template for test default.
|
private static Handler |
handler
Logging handler.
|
private static int |
INDEX_FOR_FORMATTER_HANDLER
Array index (0) of log handler to check formatter.
|
private static Boolean |
IS_APPEND
Directive to append to end of file.
|
private static Boolean |
isConfigurationLogged
Has configuration been logged?
|
private static Boolean |
isLoggingInitialized
Is logging initialized?
|
private static Level |
LOG_LEVEL
Logger directive Level.ALL to put everything to log.
|
private static Logger |
logger
Logger.
|
Modifier | Constructor and Description |
---|---|
private |
DasLogger()
Private constructor to prevent instantiation of public utility class.
|
Modifier and Type | Method and Description |
---|---|
static void |
closeLog()
Close the log.
|
static void |
flush()
Flushes any pending log writes.
|
static String |
getFileName()
Returns log file name.
|
static String |
getFormatterName()
Return class name of formatter in use.
|
static Integer |
getHandlerCount()
Returns count of log handlers.
|
static String |
getInformation()
Returns information about logger class-level configuration.
|
static String |
getLog()
Flushes cached data to disk and returns entire log.
|
static String |
getLogFilename()
Returns name of log file.
|
static Logger |
getLogger()
Returns internal logger.
|
static void |
initializeLogging()
Initializes logging.
|
static Boolean |
isAppend()
Returns append setting on log.
|
static Boolean |
isInitialized()
Returns whether logging is intialized.
|
static void |
logConfig(String configInfo)
Logs configuration data that can be used for testing private
constants etc.
|
static void |
logEntrance(String className,
String method)
Logs method kick-off sans parameters.
|
static void |
logEntrance(String className,
String method,
Object[] logEntryContent)
Logs method kick-off, depicting an array of pararmeters.
|
static void |
logException(String className,
String method,
Throwable logEntryContent)
Logs exception.
|
static void |
logExit(String className,
String method)
Logs method exit.
|
static void |
logExit(String className,
String method,
Object logEntryContent)
Logs method exit, depicting a return value.
|
static void |
logFine(String logMessage)
Logs fine level entry.
|
static String |
recentLogActivity(int beforeLength)
Returns log activity that occured after a point in time.
|
private static final String CLASS
private static final String GET_INFORMATION_TEMPLATE
= = "Dev-A-Station Logger %s\n" + "+ "==============================================\n" + "+ "|Log Level: %s" + "+ "|File Name: %s" + "+ "|Append: %s|\n + "+ "----------------------------------------------\n" + "\n";
private static final String CONFIG_ENTRY
private static final Level LOG_LEVEL
Level
.private static final String FILE_NAME
private static Logger logger
private static final Boolean IS_APPEND
private static Boolean isLoggingInitialized
private static Boolean isConfigurationLogged
private static Handler handler
private static final int INDEX_FOR_FORMATTER_HANDLER
private DasLogger()
public static String getFileName()
public static Boolean isAppend()
public static Boolean isInitialized()
public static Logger getLogger()
public static void initializeLogging()
public static void flush()
public static void closeLog()
public static String getInformation()
public static Integer getHandlerCount()
public static String getFormatterName()
public static String getLogFilename()
public static String getLog()
public static String recentLogActivity(int beforeLength)
beforeLength
- length of log before caller performed
activity of interestIllegalArgumentException
- if length passed is
negative or exceeds length
of current log.public static void logConfig(String configInfo)
configInfo
- Configuration information.public static void logEntrance(String className, String method, Object[] logEntryContent)
className
- Name of class invoking log.method
- Name of method logging method entry.logEntryContent
- Content to depict in log; can include
parameters.public static void logEntrance(String className, String method)
className
- Name of class invoking log.method
- Name of method logging method entry.public static void logExit(String className, String method)
method
- method logging exitclassName
- class invoking logpublic static void logExit(String className, String method, Object logEntryContent)
logEntryContent
- object (return
value) to depict in log entrymethod
- method logging exitclassName
- class invoking logpublic static void logException(String className, String method, Throwable logEntryContent)
className
- class invoking logmethod
- method logging the exceptionlogEntryContent
- exception to depict in log entrypublic static void logFine(String logMessage)
logMessage
- Message to be logged as fine.Copyright © 2018. All rights reserved.