public class DebugLog
extends java.lang.Object
DebugLog object can be used to log debug messages.
A class that wants to use this class should create an instant by passing its name.
Following is an example of typical use of this class.
public class MyClass
{
// Creating the logger Debug logger
private DebugLog mDbgLog = new DebugLog(this);
...
public void myMethod()
{
mDbgLog.startMethod("myMethod");
mDbgLog.log("Start.");
try
{
...
mDbgLog.log("This is a debug log message.");
...
}
finally
{
mDbgLog.endMethod();
}
}
}
| Modifier and Type | Field and Description |
|---|---|
static boolean |
forceLog
Sets to force the logging to appear on the System.out.
|
| Constructor and Description |
|---|
DebugLog(java.lang.Object obj)
Creates a
DebugLog object for a class. |
DebugLog(java.lang.String name)
Creates a
DebugLog object for a class. |
| Modifier and Type | Method and Description |
|---|---|
void |
endMethod()
Ends the current method.
|
void |
log(java.lang.Object msg)
Logs a message.
|
void |
log(java.lang.String msg1,
java.lang.String msg2)
Logs a message.
|
void |
startMethod(java.lang.String methodName)
Sets the current method name.
|
public static boolean forceLog
public DebugLog(java.lang.Object obj)
DebugLog object for a class.obj - Object for the class that uses this logger.public DebugLog(java.lang.String name)
DebugLog object for a class.name - Name of the class that uses this logger.public void startMethod(java.lang.String methodName)
methodName - Name of the method that is using the logger currently.public void endMethod()
public void log(java.lang.Object msg)
msg - Message to log.public void log(java.lang.String msg1,
java.lang.String msg2)
msg1 - Message to log.msg2 - Message to log.