public class Logger
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEBUG
A debug message
|
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 but debug (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
|
static int |
ON_ERROR_THROW_EXCEPTION
Throw a RuntimeException in case of an error (default)
|
static int |
WARNING
The message is a warning
|
Constructor and Description |
---|
Logger() |
Modifier and Type | Method and Description |
---|---|
static LogHandler |
getLogHandler()
Returns the current LogHandler.
|
static int |
getLogLevel()
Returns the log-level.
|
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 |
setLogHandler(LogHandler logHandler)
Sets a new LogHandler
|
static void |
setLogLevel(int level)
Sets the log-level.
|
static void |
setOnError(int mode)
Sets error behaviour.
|
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 int LL_ONLY_ERRORS
public static final int LL_ERRORS_AND_WARNINGS
public static final int LL_VERBOSE
public static final int LL_DEBUG
public static void setOnError(int mode)
mode
- the error modeON_ERROR_EXIT
,
ON_ERROR_RESUME_NEXT
,
ON_ERROR_THROW_EXCEPTION
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)
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()
public static void log(java.lang.String msg, int type)
public static void setLogHandler(LogHandler logHandler)
logHandler
- the log handlerpublic static LogHandler getLogHandler()