|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.creamtec.core.TraceMgr
public class TraceMgr
This class provides the basic tracing functionality, which at this point of time only allows to turn tracing on or off. However, the implementation can be extended to provide tracing based on classes and packages, which can be obtained from the object instance, that is passed to the trace method. Also, logging can also be directed to a file by extended the functionality of trace method
Field Summary | |
---|---|
static boolean |
DEBUG
Global flag, indicating if the tracing is turned on (true) or off (false) |
static int |
DEFAULT_CLASS_LEVEL
|
static boolean |
DEFAULT_CLASS_TRACE_ENABLED
|
static int |
DEFAULT_CUTOFF_LEVEL
|
static int |
DEFAULT_ERROR_LEVEL
|
static int |
DEFAULT_TRACE_LEVEL
|
static int |
DEFAULT_WARNING_LEVEL
|
static boolean |
mPrintDate
|
static java.lang.String |
PROPERTIES_FILE_NAME
|
Constructor Summary | |
---|---|
TraceMgr()
|
Method Summary | |
---|---|
static java.lang.String |
className(java.lang.Class cls,
java.lang.String msg)
|
static void |
dumpSystemInfo()
|
static int |
getCutoffLevel()
|
static java.lang.String |
getExceptionText(java.lang.String msg,
java.lang.Throwable x)
Returns the message, appended with the details of exception (exception type and text |
static java.lang.String |
getExceptionText(java.lang.String msg,
java.lang.Throwable x,
boolean detailed)
|
static java.io.Writer |
getFileWriter()
Returns the log file writer |
static java.lang.String |
getLogFileName()
|
static int |
getTraceLevel(java.lang.Class cls)
Returns true if the tracing is enabled for the given class |
static int |
getTraceLevel(java.lang.Object obj)
Returns true if the tracing is enabled for the given object |
static boolean |
getWriteToConsole()
|
static boolean |
getWriteToFile()
|
static void |
loadSettings()
|
static void |
newLine()
Outputs a new line |
static void |
printStackTrace()
|
static void |
printStackTrace(int cutoffLevel)
|
static void |
setCutoffLevel(int cutoffLevel)
|
static void |
setFileWriter(java.io.Writer writer)
Sets the file writer that will receive log messages Note: if there is an existing log file writer, it is the caller's responsibility to close it. |
static void |
setLoadSettings(boolean load)
|
static void |
setLogFileName(java.lang.String fileName)
|
static void |
setWriteToConsole(boolean write)
|
static void |
setWriteToFile(boolean write)
|
static void |
trace(java.lang.Class cls,
java.lang.String msg)
Outputs a single trace to the application console window, prepended by the name of the class, that obj is instance of |
static void |
trace(java.lang.Class cls,
java.lang.String msg,
int level)
|
static void |
trace(java.lang.Class cls,
java.lang.String msg,
java.lang.Throwable x)
Outputs a single trace to the application console window, prepended by the name of the class, that obj is instance of; exception information is appended to the trace line to show the type of the exception and the exception text. |
static void |
trace(java.lang.Class cls,
java.lang.String msg,
java.lang.Throwable x,
int level)
|
static void |
trace(java.lang.Object obj,
java.lang.String msg)
Outputs a single trace to the application console window, prepended by the name of the class, that obj is instance of |
static void |
trace(java.lang.Object obj,
java.lang.String msg,
int level)
|
static void |
trace(java.lang.Object obj,
java.lang.String msg,
java.lang.Throwable x)
Outputs a single trace to the application console window, prepended by the name of the class, that obj is instance of; exception information is appended to the trace line to show the type of the exception and the exception text. |
static void |
trace(java.lang.Object obj,
java.lang.String msg,
java.lang.Throwable x,
int level)
|
static void |
trace(java.lang.String msg)
Outputs a single trace to the console window |
static void |
trace(java.lang.String msg,
int level)
|
static void |
trace(java.lang.String msg,
java.lang.Throwable x)
|
static void |
trace(java.lang.String msg,
java.lang.Throwable x,
int level)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEBUG
public static boolean mPrintDate
public static final boolean DEFAULT_CLASS_TRACE_ENABLED
public static int DEFAULT_CUTOFF_LEVEL
public static int DEFAULT_TRACE_LEVEL
public static int DEFAULT_WARNING_LEVEL
public static int DEFAULT_ERROR_LEVEL
public static int DEFAULT_CLASS_LEVEL
public static final java.lang.String PROPERTIES_FILE_NAME
Constructor Detail |
---|
public TraceMgr()
Method Detail |
---|
public static void trace(java.lang.String msg)
msg
- text of the tracepublic static void trace(java.lang.String msg, int level)
public static int getCutoffLevel()
public static void setCutoffLevel(int cutoffLevel)
public static void setFileWriter(java.io.Writer writer)
writer
- Writerpublic static java.io.Writer getFileWriter()
public static void newLine()
public static void trace(java.lang.Object obj, java.lang.String msg)
obj
- object, that is outputing the tracemsg
- text of the tracepublic static void trace(java.lang.Object obj, java.lang.String msg, int level)
public static void trace(java.lang.Object obj, java.lang.String msg, java.lang.Throwable x)
obj
- object, that is outputing the tracemsg
- text of the tracex
- exception, that will be appended to the trace messagepublic static void trace(java.lang.Object obj, java.lang.String msg, java.lang.Throwable x, int level)
public static void trace(java.lang.Class cls, java.lang.String msg)
cls
- object, that is outputing the tracemsg
- text of the tracepublic static void trace(java.lang.Class cls, java.lang.String msg, int level)
public static java.lang.String className(java.lang.Class cls, java.lang.String msg)
public static void trace(java.lang.Class cls, java.lang.String msg, java.lang.Throwable x)
cls
- class, that is outputing the tracemsg
- text of the tracex
- exception, that will be appended to the trace messagepublic static void trace(java.lang.Class cls, java.lang.String msg, java.lang.Throwable x, int level)
public static void trace(java.lang.String msg, java.lang.Throwable x)
public static void trace(java.lang.String msg, java.lang.Throwable x, int level)
public static java.lang.String getExceptionText(java.lang.String msg, java.lang.Throwable x)
public static java.lang.String getExceptionText(java.lang.String msg, java.lang.Throwable x, boolean detailed)
public static final int getTraceLevel(java.lang.Object obj)
public static final int getTraceLevel(java.lang.Class cls)
public static void loadSettings() throws java.lang.Exception
java.lang.Exception
public static void dumpSystemInfo()
public static void printStackTrace()
public static void printStackTrace(int cutoffLevel)
public static void setLogFileName(java.lang.String fileName)
public static java.lang.String getLogFileName()
public static void setLoadSettings(boolean load)
public static void setWriteToFile(boolean write)
public static boolean getWriteToFile()
public static void setWriteToConsole(boolean write)
public static boolean getWriteToConsole()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |