public final class Logging
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
FILTER_EXCLUDE
A list of packages or classes that should not be logged.
|
static java.lang.String[] |
FILTER_INCLUDE
A list of packages or classes that should be logged in any case.
|
static int |
MAXIMUM_VERBOSITY
Maximum verbosity is like normal verbosity but it also includes debug messages.
|
static int |
MINIMUM_VERBOSITY
Minimum verbosity disables all log messages.
|
static int |
NORMAL_VERBOSITY
Normal verbosity contains log and error messages.
|
static int |
TIME_ABSOLUTE
Denotes that a log message must contain an absolute time stamp.
|
static long |
TIME_BASE
The load time of the class used to calculate relative time stamps.
|
static int |
TIME_DISABLED
Denotes that a log message must not contain a time stamp.
|
static int |
TIME_RELATIVE
Denotes that a logged message must contain a relative time stamp.
|
static int |
TIME_ZONE
The time zone for absolute time stamps (UTC +1, Germany).
|
Constructor and Description |
---|
Logging() |
Modifier and Type | Method and Description |
---|---|
static void |
debug(java.lang.Class location,
java.lang.String message)
Write a debug message to the specified output.
|
static void |
debug(java.lang.String location,
java.lang.String message)
Write a debug message to the specified output.
|
static void |
error(java.lang.Class location,
java.lang.String message,
java.lang.Throwable e)
Writes an error message to the specified output.
|
static void |
error(java.lang.String location,
java.lang.String message,
java.lang.Throwable e)
Writes an error message to the specified output.
|
static int |
getVerbosity()
Returns the current verbosity level of the logger.
|
static void |
log(java.lang.Class location,
java.lang.String message)
Writes a log message to the specified output.
|
static void |
log(java.lang.String location,
java.lang.String message)
Writes a log message to the specified output.
|
static void |
setOutput(java.io.PrintStream stream)
Sets the output of the logging facility to the specified print
stream.
|
static void |
setTrace(boolean trace)
Enables or disables traces of exceptions.
|
static void |
setVerbosity(int level)
Sets the verbosity level of the logger.
|
static java.lang.String |
timestamp(long millis)
Returns a pretty printed time stamp whose format depends on the time
parameter of the logging class.
|
public static java.lang.String[] FILTER_EXCLUDE
public static java.lang.String[] FILTER_INCLUDE
public static final int MINIMUM_VERBOSITY
public static final int NORMAL_VERBOSITY
public static final int MAXIMUM_VERBOSITY
public static final int TIME_DISABLED
public static final int TIME_ABSOLUTE
public static final int TIME_RELATIVE
public static final int TIME_ZONE
public static final long TIME_BASE
public static void setVerbosity(int level)
level
- The must be one of the verbosity constants.public static int getVerbosity()
public static void setTrace(boolean trace)
trace
- True to enable tracing, false to disable.public static void setOutput(java.io.PrintStream stream)
stream
- The stream to print to.public static void log(java.lang.String location, java.lang.String message)
location
- The source of the message used for filtering.message
- The message to be logged.public static void log(java.lang.Class location, java.lang.String message)
location
- The source of the message used for filtering.message
- The message to be logged.public static void error(java.lang.String location, java.lang.String message, java.lang.Throwable e)
location
- The source of the message.message
- The message to be logged.e
- The exception caused this message used for traces.public static void error(java.lang.Class location, java.lang.String message, java.lang.Throwable e)
location
- The source of the message.message
- The message to be logged.e
- The exception caused this message used for traces.public static void debug(java.lang.String location, java.lang.String message)
location
- The source of the message used for filtering.message
- The message to be logged.public static void debug(java.lang.Class location, java.lang.String message)
location
- The source of the message used for filtering.message
- The message to be logged.public static java.lang.String timestamp(long millis)
millis
- The milliseconds to pretty print.