public final class Log
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getLogFileName()
Compute the filename of the log file
|
static java.lang.String |
getLogFilePath()
Compute the full path of the log file
|
static java.lang.String |
getLogLocation()
Returns the path to the log file.
|
protected static void |
init(java.io.InputStream in)
Initialize handlers manually.
|
static void |
log(java.lang.String s)
Logs what otherwise would go to System.out
|
static void |
log(java.lang.Throwable throwable)
Logs an Exception or Error.
|
static void |
logDebug(java.util.logging.Logger logger,
java.lang.String message,
java.lang.Object... parameters)
Writes debug message to log (without localization)
|
static void |
logErrorRB(java.lang.String key,
java.lang.Object... parameters)
Writes an error message to the log (to be retrieved from the resource
bundle)
|
static void |
logErrorRB(java.lang.Throwable ex,
java.lang.String key,
java.lang.Object... parameters)
Writes an error message to the log (to be retrieved from the resource
bundle)
|
static void |
logInfoRB(java.lang.String key,
java.lang.Object... parameters)
Writes an info message to the log (to be retrieved from the resource
bundle)
|
static void |
logRB(java.lang.String key,
java.lang.Object... parameters)
Logs a message, retrieved from the resource bundle.
|
static void |
logWarningRB(java.lang.String key,
java.lang.Object... parameters)
Writes a warning message to the log (to be retrieved from the resource
bundle)
|
static void |
setLevel(java.util.logging.Level level)
Set the level for the global logger.
|
protected static void init(java.io.InputStream in) throws java.io.IOException
in
- settingsjava.io.IOException
public static java.lang.String getLogLocation()
public static java.lang.String getLogFileName()
public static java.lang.String getLogFilePath()
public static void setLevel(java.util.logging.Level level)
logger.properties
file; use this method to override for
special use cases.level
- The new levelpublic static void log(java.lang.String s)
public static void logRB(java.lang.String key, java.lang.Object... parameters)
key
- The key of the message in the resource bundle.parameters
- Parameters for the message. These are inserted by using
StaticUtils.format.public static void log(java.lang.Throwable throwable)
throwable
- The exception or error to logpublic static void logWarningRB(java.lang.String key, java.lang.Object... parameters)
While the warning message can be localized, the warning key is also logged, so developers can determine what warning was given by looking at the error key, instead of trying to interpret localized messages.
key
- The key of the error message in the resource bundleparameters
- Parameters for the error message. These are inserted by using
StaticUtils.format.public static void logInfoRB(java.lang.String key, java.lang.Object... parameters)
While the info message can be localized, the info key is also logged, so developers can determine what info was given by looking at the error key, instead of trying to interpret localized messages.
key
- The key of the error message in the resource bundleparameters
- Parameters for the error message. These are inserted by using
StaticUtils.format.public static void logErrorRB(java.lang.String key, java.lang.Object... parameters)
While the error message can be localized, the error key is also logged, so developers can determine what error was given by looking at the error key, instead of trying to interpret localized messages.
key
- The key of the error message in the resource bundleparameters
- Parameters for the error message. These are inserted by using
StaticUtils.format.public static void logErrorRB(java.lang.Throwable ex, java.lang.String key, java.lang.Object... parameters)
While the error message can be localized, the error key is also logged, so developers can determine what error was given by looking at the error key, instead of trying to interpret localized messages.
ex
- The error that was thrownkey
- The key of the error message in the resource bundleparameters
- Parameters for the error message. These are inserted by using
StaticUtils.format.public static void logDebug(java.util.logging.Logger logger, java.lang.String message, java.lang.Object... parameters)
message
- message textparameters
- Parameters for the error message. These are inserted by using
StaticUtils.format.