Class Log
- java.lang.Object
- 
- org.omegat.util.Log
 
- 
 public final class Log extends java.lang.ObjectA collection of methods to make logging things easier.
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetLogFileName()Compute the filename of the log filestatic java.lang.StringgetLogFilePath()Compute the full path of the log filestatic java.lang.StringgetLogLocation()Returns the path to the log file.static voidlog(java.lang.String s)Logs what otherwise would go to System.outstatic voidlog(java.lang.Throwable throwable)Logs an Exception or Error.static voidlogDebug(java.util.logging.Logger logger, java.lang.String message, java.lang.Object... parameters)Writes debug message to log (without localization)static voidlogErrorRB(java.lang.String key, java.lang.Object... parameters)Writes an error message to the log (to be retrieved from the resource bundle)static voidlogErrorRB(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 voidlogInfoRB(java.lang.String key, java.lang.Object... parameters)Writes an info message to the log (to be retrieved from the resource bundle)static voidlogRB(java.lang.String key, java.lang.Object... parameters)Logs a message, retrieved from the resource bundle.static voidlogWarningRB(java.lang.String key, java.lang.Object... parameters)Writes a warning message to the log (to be retrieved from the resource bundle)static voidsetLevel(java.util.logging.Level level)Set the level for the global logger.
 
- 
- 
- 
Method Detail- 
getLogLocationpublic static java.lang.String getLogLocation() Returns the path to the log file.
 - 
getLogFileNamepublic static java.lang.String getLogFileName() Compute the filename of the log file- Returns:
- the filename of the log, or an empty string
 
 - 
getLogFilePathpublic static java.lang.String getLogFilePath() Compute the full path of the log file- Returns:
- the full path of the log file
 
 - 
setLevelpublic static void setLevel(java.util.logging.Level level) Set the level for the global logger. This is normally determined by thelogger.propertiesfile; use this method to override for special use cases.- Parameters:
- level- The new level
 
 - 
logpublic static void log(java.lang.String s) Logs what otherwise would go to System.out
 - 
logRBpublic static void logRB(java.lang.String key, java.lang.Object... parameters)Logs a message, retrieved from the resource bundle.- Parameters:
- key- The key of the message in the resource bundle.
- parameters- Parameters for the message. These are inserted by using StaticUtils.format.
 
 - 
logpublic static void log(java.lang.Throwable throwable) Logs an Exception or Error. To the log are written: - The class name of the Exception or Error - The message, if any - The stack trace- Parameters:
- throwable- The exception or error to log
 
 - 
logWarningRBpublic 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)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. - Parameters:
- key- The key of the error message in the resource bundle
- parameters- Parameters for the error message. These are inserted by using StaticUtils.format.
 
 - 
logInfoRBpublic 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)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. - Parameters:
- key- The key of the error message in the resource bundle
- parameters- Parameters for the error message. These are inserted by using StaticUtils.format.
 
 - 
logErrorRBpublic 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)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. - Parameters:
- key- The key of the error message in the resource bundle
- parameters- Parameters for the error message. These are inserted by using StaticUtils.format.
 
 - 
logErrorRBpublic 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)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. - Parameters:
- ex- The error that was thrown
- key- The key of the error message in the resource bundle
- parameters- Parameters for the error message. These are inserted by using StaticUtils.format.
 
 - 
logDebugpublic static void logDebug(java.util.logging.Logger logger, java.lang.String message, java.lang.Object... parameters)Writes debug message to log (without localization)- Parameters:
- message- message text
- parameters- Parameters for the error message. These are inserted by using StaticUtils.format.
 
 
- 
 
-