|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object logging.LogHolder
public final class LogHolder
This class stores the Log instance.
Field Summary | |
---|---|
static int |
DETAIL_LEVEL_HIGH
prints the log message, package, classname, method name and the source line of the log message; this enables some IDEs to jump to the log source by clicking on the message line |
static int |
DETAIL_LEVEL_HIGHEST
additionally prints the whole stack trace of an error log if available |
static int |
DETAIL_LEVEL_LOWER
prints the log message, the class name and the source line of the log message |
static int |
DETAIL_LEVEL_LOWEST
prints the log message only |
private static java.lang.String[] |
DETAIL_LEVEL_NAMES
|
private static int |
LINE_LENGTH_HIGH_DETAIL
|
private static int |
LINE_LENGTH_HIGHEST_DETAIL
|
private static java.lang.String |
LOGGED_THROWABLE
|
private static int |
m_messageDetailLevel
The current detail level of all log messages. |
private static LogHolder |
ms_logHolderInstance
Stores the instance of LogHolder (Singleton). |
private static Log |
ms_logInstance
Stores the Log instance. |
private static java.lang.String |
TRACED_LOG_MESSAGE
|
Constructor Summary | |
---|---|
private |
LogHolder()
This creates a new instance of LogHolder. |
Method Summary | |
---|---|
void |
finalize()
|
private static java.lang.String |
getCallingClassFile(boolean a_bSkipOwnClass)
Returns the filename and line number of the calling method (from outside this class) in the form (class.java: . |
private static java.lang.String |
getCallingMethod(boolean a_bSkipOwnClass)
Returns the name, class, file and line number of the calling method (from outside this class) in the form package.class.method(class.java: . |
static int |
getDetailLevel()
Gets the detail level of all log messages. |
static int |
getDetailLevelCount()
|
static java.lang.String |
getDetailLevelName(int a_detail)
|
private static Log |
getLogInstance()
Returns the logInstance. |
static boolean |
isLogged(int a_logLevel,
int a_logType)
|
static void |
log(int logLevel,
int logType,
java.lang.String message)
Write the log data to the Log instance. |
static void |
log(int logLevel,
int logType,
java.lang.String message,
boolean a_bAddCallingClass)
Write the log data to the Log instance. |
static void |
log(int a_logLevel,
int a_logType,
java.lang.String a_message,
java.lang.Throwable a_throwable)
Write the log data for a Throwable to the Log instance. |
static void |
log(int a_logLevel,
int a_logType,
java.lang.Throwable a_throwable)
Write the log data for a Throwable to the Log instance. |
static boolean |
setDetailLevel(int a_messageDetailLevel)
Sets the detail level of all log messages. |
static void |
setLogInstance(Log logInstance)
Sets the logInstance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DETAIL_LEVEL_LOWEST
public static final int DETAIL_LEVEL_LOWER
public static final int DETAIL_LEVEL_HIGH
public static final int DETAIL_LEVEL_HIGHEST
private static final java.lang.String[] DETAIL_LEVEL_NAMES
private static final java.lang.String TRACED_LOG_MESSAGE
private static final java.lang.String LOGGED_THROWABLE
private static final int LINE_LENGTH_HIGH_DETAIL
private static final int LINE_LENGTH_HIGHEST_DETAIL
private static LogHolder ms_logHolderInstance
private static int m_messageDetailLevel
private static Log ms_logInstance
Constructor Detail |
---|
private LogHolder()
Method Detail |
---|
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public static int getDetailLevelCount()
public static java.lang.String getDetailLevelName(int a_detail)
public static boolean setDetailLevel(int a_messageDetailLevel)
a_messageDetailLevel
- the detail level of all log messagespublic static int getDetailLevel()
public static void log(int a_logLevel, int a_logType, java.lang.Throwable a_throwable)
a_logLevel
- The log level (see constants in class LogLevel).a_logType
- The log type (see constants in class LogType).a_throwable
- a Throwable to logpublic static void log(int a_logLevel, int a_logType, java.lang.String a_message, java.lang.Throwable a_throwable)
a_logLevel
- The log level (see constants in class LogLevel).a_logType
- The log type (see constants in class LogType).a_message
- an (optional) log messagea_throwable
- a Throwable to logpublic static void log(int logLevel, int logType, java.lang.String message, boolean a_bAddCallingClass)
logLevel
- The log level (see constants in class LogLevel).logType
- The log type (see constants in class LogType).message
- The message to log.a_bAddCallingClass
- true if not only the name and class of the current method should be logged
but also the name of the method in the class that has called this method;
false if only the name of the current method should be logged (default)public static void log(int logLevel, int logType, java.lang.String message)
logLevel
- The log level (see constants in class LogLevel).logType
- The log type (see constants in class LogType).message
- The message to log.public static void setLogInstance(Log logInstance)
logInstance
- The instance of a Log implementation.private static Log getLogInstance()
public static boolean isLogged(int a_logLevel, int a_logType)
private static java.lang.String getCallingClassFile(boolean a_bSkipOwnClass)
(class.java:)
.
a_bSkipOwnClass
- if true, the true calling method is skipped and the class file
of the first method in the stack trace of the calling class
that is in another class than itself is returned;
if false, the class file of the calling method is returned (default)
private static java.lang.String getCallingMethod(boolean a_bSkipOwnClass)
package.class.method(class.java:)
.
This method does need some processing time, as an exception with the stack trace is generated.
a_bSkipOwnClass
- if true, the true calling method is skipped and the caller of the
first method in the stack trace of calling method that is in another
class than itself is returned; if false, the calling method is
returned (default)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |