|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.izforge.izpack.util.Debug
public class Debug
This class is for debug purposes. It is highly recommended to use it on critical or experimental
code places. To enable the debug mode of IzPack, just start the installer with the java parameter
-DTRACE=true or -DSTACKTRACE=true to enable extendend output of the internal status of critical
objects.
How to use it as IzPack Setup Developer:
Just import this class and use one of the methods:
Field Summary | |
---|---|
static java.lang.String |
DLOG
Parameter for public javacall "java -jar izpack.jar -DLOG" (Class.internal.variable: (DLOG = "LOG")) |
static java.lang.String |
DSTACKTRACE
Parameter for public javacall "java -jar izpack.jar -DSTACKTRACE" (Class.internal.variable: (DSTACKTRACE = "STACKTRACE")) |
static java.lang.String |
DTRACE
Parameter for public javacall "java -jar izpack.jar -DTRACE" (Class.internal.variable: (DTRACE = "TRACE")) |
static java.lang.String |
IZPACK_LOGFILE
System.Property Key: IZPACK_LOGFILE = "izpack.logfile" |
private static boolean |
LOG
internal initial unintialized LOG-flag |
static int |
LOG_WITH_DATE
LOG_WITH_DATE = 1 |
static int |
LOG_WITH_TIME_AND_DATE
LOG_WITH_TIME_AND_DATE= LOG_WITH_DATE | LOG_WITH_TIME_STAMP = 3 |
static int |
LOG_WITH_TIME_STAMP
LOG_WITH_TIME_STAMP = 2 |
static int |
LOG_WITHOUT_DATE
LOG_WITHOUT_DATE = 0 |
static java.lang.String |
LOGFILE_EXTENSION
LOGFILE_EXTENSION = ".txt" |
static java.lang.String |
LOGFILE_PREFIX
LOGFILE_PREFIX = "IzPack_Logfile_at_" |
static java.lang.String |
LOGFILENAME
LOGFILENAME = LOGFILE_PREFIX + System.currentTimeMillis() + LOGFILE_EXTENSION |
private static boolean |
STACKTRACE
internal initial unintialized STACKTRACE-flag |
private static boolean |
TRACE
internally initial unintialized TRACE-flag |
Constructor Summary | |
---|---|
Debug()
|
Method Summary | |
---|---|
private static java.io.PrintWriter |
createLogFile()
Creates the logfile to write log-infos into. |
static void |
error(java.lang.Object s)
Traces the given object and additional write their status in the LOGFILE. |
static java.io.PrintWriter |
getLogFile()
Get the Logfile |
static boolean |
isLOG()
Returns the LOG flag. |
static boolean |
isSTACKTRACE()
Returns the current STACKTRACE flag |
static boolean |
isTRACE()
Gets the current TRACE flag |
static void |
log(java.lang.Object o)
Logs the given Object in the created Logfile if -DLOG=true was given on commandline i.e: java -DLOG=true -jar izpack-installer.jar |
static void |
log(java.lang.Object o,
int withWhatFormat)
Logs the given Object in the created Logfile if -DLOG=true was given on commandline i.e: java -DLOG=true -jar izpack-installer.jar |
private static boolean |
logWithDate(int withWhatFormat)
Indicates that to log with Date. |
private static boolean |
logWithTimeStamp(int withWhatFormat)
Indicates that to log with Timestamp. |
static void |
setLOG(boolean aFlag)
Sets The LOG like the given value |
static java.io.PrintWriter |
setLogFile(java.io.PrintWriter aLogFile)
Sets the Logfile |
static void |
setSTACKTRACE(boolean aFlag)
Sets the STACKTRACE like the given value |
static void |
setTRACE(boolean aFlag)
Sets the TRACE flag like the given value |
static boolean |
stackTracing()
Indicates if debug is stacktracing |
static void |
trace(java.lang.Object s)
Traces the internal status of the given Object |
static boolean |
tracing()
Indicates if debug is tracing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DLOG
public static final java.lang.String DSTACKTRACE
public static final java.lang.String DTRACE
public static final java.lang.String IZPACK_LOGFILE
public static final int LOG_WITHOUT_DATE
public static final int LOG_WITH_DATE
public static final int LOG_WITH_TIME_STAMP
public static final int LOG_WITH_TIME_AND_DATE
private static boolean TRACE
private static boolean STACKTRACE
private static boolean LOG
public static java.lang.String LOGFILE_PREFIX
public static java.lang.String LOGFILE_EXTENSION
public static java.lang.String LOGFILENAME
Constructor Detail |
---|
public Debug()
Method Detail |
---|
public static void trace(java.lang.Object s)
s
- public static void error(java.lang.Object s)
s
- public static void log(java.lang.Object o)
o
- The Object to log, can be also an exception.public static void log(java.lang.Object o, int withWhatFormat)
o
- The Object to logwithWhatFormat
- if the given MASK is greater than 0, Log with Date/Timestampprivate static boolean logWithDate(int withWhatFormat)
withWhatFormat
- The whished Format
private static boolean logWithTimeStamp(int withWhatFormat)
withWhatFormat
- The whished Format
private static java.io.PrintWriter createLogFile()
public static boolean tracing()
public static boolean stackTracing()
public static boolean isLOG()
public static void setLOG(boolean aFlag)
aFlag
- The LOG status to set to or not.public static boolean isSTACKTRACE()
public static void setSTACKTRACE(boolean aFlag)
aFlag
- The STACKTRACE to set / unset.public static boolean isTRACE()
public static void setTRACE(boolean aFlag)
aFlag
- The TRACE to set / unset.public static java.io.PrintWriter getLogFile()
public static java.io.PrintWriter setLogFile(java.io.PrintWriter aLogFile)
aLogFile
- The logFile to set. *
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |