|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.threed.jpct.Logger
Logger is jPCT's simple logging class for printing and storing messages, errors and warnings. Every message jPCT generates will be processed by this class.
Field Summary | |
static int |
DEBUG
A debug message |
static boolean |
DISCARD_MESSAGES
Don't store the messages |
static int |
ERROR
The message is an error |
static int |
LL_DEBUG
Log-Level: log everything including debug |
static int |
LL_ERRORS_AND_WARNINGS
Log-Level: log errors and warnings |
static int |
LL_ONLY_ERRORS
Log-Level: log errors only |
static int |
LL_VERBOSE
Log-Level: log everything (default) |
static int |
MESSAGE
The message is just that: a message |
static int |
ON_ERROR_EXIT
Exit after an error occurs |
static int |
ON_ERROR_RESUME_NEXT
Try to continue even in case of an error (default) |
static int |
ON_ERROR_THROW_EXCEPTION
Throw a RuntimeException in case of an error |
static boolean |
STORE_MESSAGES
Store logged messages in an internal message-buffer |
static int |
WARNING
The message is a warning |
Constructor Summary | |
Logger()
|
Method Summary | |
static int |
getLogLevel()
Returns the log-level. |
static java.lang.String[] |
getMessageBuffer()
Returns the current message-buffer as String-array. |
static boolean |
isDebugEnabled()
Returns true, if debug log level is active. |
static void |
log(java.lang.String msg)
Logs a message. |
static void |
log(java.lang.String msg,
int type)
Logs a message, error or warning. |
static void |
log(java.lang.Throwable tw)
Logs an exception as an error. |
static void |
log(java.lang.Throwable tw,
int type)
Logs an exception. |
static void |
setLogLevel(int level)
Sets the log-level. |
static void |
setMessageBuffer(boolean mode)
Sets the message-buffer to store messages or to discard them after logging. |
static void |
setOnError(int mode)
Sets error behaviour. |
static void |
setOutputBuffering(int rows)
Sets how many messages should be stored in the message buffer before they are printed out. |
static void |
setPrintStream(java.io.PrintStream ps)
Sets the logging PrintStream. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ERROR
public static final int WARNING
public static final int MESSAGE
public static final int DEBUG
public static final int ON_ERROR_THROW_EXCEPTION
public static final int ON_ERROR_EXIT
public static final int ON_ERROR_RESUME_NEXT
public static final boolean STORE_MESSAGES
public static final boolean DISCARD_MESSAGES
public static final int LL_ONLY_ERRORS
public static final int LL_ERRORS_AND_WARNINGS
public static final int LL_VERBOSE
public static final int LL_DEBUG
Constructor Detail |
public Logger()
Method Detail |
public static void setPrintStream(java.io.PrintStream ps)
ps
- the Printstream to log intopublic static void setOutputBuffering(int rows)
rows
- the number of buffered rowspublic static void setMessageBuffer(boolean mode)
mode
- the modeSTORE_MESSAGES
,
DISCARD_MESSAGES
public static void setOnError(int mode)
mode
- the error modeON_ERROR_EXIT
,
ON_ERROR_RESUME_NEXT
,
ON_ERROR_THROW_EXCEPTION
public static java.lang.String[] getMessageBuffer()
public static void setLogLevel(int level)
level
- the log-levelLL_ONLY_ERRORS
,
LL_ERRORS_AND_WARNINGS
,
LL_VERBOSE
,
LL_DEBUG
public static int getLogLevel()
LL_ONLY_ERRORS
,
LL_ERRORS_AND_WARNINGS
,
LL_VERBOSE
,
LL_DEBUG
public static void log(java.lang.String msg, int type)
msg
- the message to logtype
- the type of messageERROR
,
WARNING
,
MESSAGE
,
DEBUG
public static void log(java.lang.String msg)
msg
- the messagepublic static void log(java.lang.Throwable tw)
tw
- the exceptionpublic static void log(java.lang.Throwable tw, int type)
tw
- the exceptiontype
- the type of messagepublic static boolean isDebugEnabled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |