|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openoffice.xmerge.util.Debug
This class is used for logging debug messages.
Currently, there are three types of logging: INFO
,
TRACE
& ERROR
. Use the Debug.properties
file to set or unset each type. Also use Debug.properties
to set the writer to either System.out
,
System.err
, or to a file.
Field Summary | |
static int |
ERROR
Error messages. |
static int |
INFO
Informational messages. |
static boolean |
SET
To set a flag. |
static int |
TRACE
Trace messages. |
static boolean |
UNSET
To unset a flag. |
Method Summary | |
static java.lang.String |
byteArrayToHexString(byte[] bytes)
Converts the given bytes to a String of
Hex digits. |
static boolean |
isFlagSet(int f)
Checks if flag is set. |
static void |
log(int flag,
java.lang.String msg)
Log message based on the flag type. |
static void |
log(int flag,
java.lang.String msg,
java.lang.Throwable e)
Log message based on flag type plus print out stack trace of the exception passed in. |
static void |
logSystemInfo()
Prints out information regarding platform. |
static void |
logTime()
Prints out timestamp. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ERROR
public static final int INFO
public static final boolean SET
public static final int TRACE
public static final boolean UNSET
Method Detail |
public static java.lang.String byteArrayToHexString(byte[] bytes)
String
of
Hex digits.bytes
- byte
array.String
.public static boolean isFlagSet(int f)
public static void log(int flag, java.lang.String msg)
Log message based on the flag type.
Example 1:
Debug.log(Debug.INFO, "info string here");
This logs the message during runtime if
debug.info
in the properties file is
set to true.
Example 2:
Debug.log(Debug.INFO | Debug.TRACE, "info string here");
This logs the message during runtime if debug.info or debug.trace in the properties file is set to true.
int
- Log type, one of the Debug constants
INFO
, TRACE
, ERROR
or a combination of which or'ed together.msg
- The message.public static void log(int flag, java.lang.String msg, java.lang.Throwable e)
int
- Log type, one of the Debug constants
INFO
, TRACE
, ERROR
or a combination of which or'ed together.msg
- The message.e
- Throwable object.public static void logSystemInfo()
public static void logTime()
|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |