public final class OutputUtil
extends java.lang.Object
| Modifier and Type | Field and Description | 
|---|---|
private static boolean | 
logable
An information flag which indicates if it will be possible to log messages to a file using the  
logger. | 
private static java.util.logging.Logger | 
logger
A  
Logger object for logfile output. | 
| Modifier | Constructor and Description | 
|---|---|
private  | 
OutputUtil()
Prevent instances of this utility class. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
private static java.lang.String | 
buildMessage(java.lang.String msg)
Builds a message from the given message. 
 | 
private static void | 
configLogger()
Sets up a logger without console output with name LOGGER_NAME. 
 | 
static void | 
debug(java.lang.String msg)
Handles a debug messages depending on the current configuration in  
MainConfig. | 
static void | 
endSystemWithError(java.lang.String msg)
Handles the error message using  
handleError(String, Level). | 
static void | 
error(java.lang.String msg)
Handles an error messages depending on the current configuration in  
MainConfig. | 
static void | 
handleError(java.lang.String msg,
           java.util.logging.Level lvl)
Handles an error message depending on the current configuration in  
MainConfig. | 
static void | 
handleMessage(java.lang.String msg,
             java.util.logging.Level lvl)
Handles an info or debug message depending on the current configuration in  
MainConfig. | 
static void | 
info(java.lang.String msg)
Handles an info messages depending on the current configuration in  
MainConfig. | 
static void | 
log(java.util.logging.Level lvl,
   java.lang.String msg)
 | 
private static java.util.logging.Logger logger
Logger object for logfile output. This object will be only set once a programs life time.private static boolean logable
logger. 
 It will be set to false if the method configLogger() is, for some reasons, unable to create
  the specified logfile.public static void debug(java.lang.String msg)
MainConfig. This method will only work
 if DEBUG is set to true.true, the message will printed to console (prefixed by the class 
 name, if it isn't null).true, the message will be logged to the logfile with level 
 WARNING and the class name, if it isn't null.msg - A debug message as String.public static void info(java.lang.String msg)
MainConfig. This method will only work
 if INFO is set to true.true, the message will printed to console (prefixed by the class 
 name, if it isn't null).true, the message will be logged to the logfile with level 
 INFO and the class name, if it isn't null.msg - An info message as String.public static void error(java.lang.String msg)
MainConfig. This method will only 
 work if ERROR is set to true. true, the message will printed as error to console (prefixed by the
 class name, if it isn't null).true, the message will be logged to the logfile with level 
 SEVERE and the class name, if it isn't null.msg - An error message as String.public static void endSystemWithError(java.lang.String msg)
handleError(String, Level). Sends a stop order on the 
 LP_CONTROL_TOPIC using the JSON message JsonConfigOrder to itself to gracefully end this agent.msg - An error message as String.public static void handleMessage(java.lang.String msg,
                 java.util.logging.Level lvl)
MainConfig.true, the message will printed to console (prefixed by the class 
 name or Unknown if it's null).true, the message will be logged to the logfile with the specified 
 Level and the class name or Unknown if it's null.msg - An info or debug message as String.lvl - A logging Level.public static void handleError(java.lang.String msg,
               java.util.logging.Level lvl)
MainConfig.true, the message will printed as error to console (prefixed by the
 class name or Unknown if it's null).true, the message will be logged to the logfile with the specified 
 Level and the class name or Unknown if it's 
 null.msg - An error message as String.lvl - A logging Level.private static java.lang.String buildMessage(java.lang.String msg)
msg - A message as String.String containing the originators class and method name.public static void log(java.util.logging.Level lvl,
       java.lang.String msg)
Level to the logfile by using the logger, if 
 logable is set to true. If no logger is configured, the method will call 
 configLogger() to create on.lvl - A logging Level.msg - A message as String which shall be logged to the logfile.private static void configLogger()
Level.WARNING will be written as DEBUG. If it is not possible to create the logfile, the whole 
 system will end itself controlled with console output.