elge.engine
Class Debug

java.lang.Object
  |
  +--elge.engine.Debug

public class Debug
extends Object

Debug is the main class and with mainly static methods to provide an easy interface for printing messages from the code to the output.

For now, the Debug uses a Log4J library and its basic configuration to log the messages (that means no debug is printed, only the INFO and about levels).

Author:
Pavol Žibrita

Field Summary
protected static Debug shared
          The shared isntance that is used.
 
Method Summary
static void debug(Class cls, String message)
          Prints debug (log4j DEBUG level) message.
static void debug(Class cls, String message, Throwable ex)
          Prints debug (log4j DEBUG level) message.
static void debug(Object obj, String message)
          Prints debug (log4j DEBUG level) message.
static void debug(Object obj, String message, Throwable ex)
          Prints debug (log4j DEBUG level) message.
static void error(Class cls, String message)
          Prints error message.
static void error(Class cls, String message, Throwable ex)
          Prints error message.
static void error(Object obj, String message)
          Prints error message.
static void error(Object obj, String message, Throwable ex)
          Prints error message.
static void loadConfig()
          Loads the config for the log4j.
static void trace(Class cls, String message)
          Prints info (log4j INFO level) message.
static void trace(Class cls, String message, Throwable ex)
          Prints info (log4j INFO level) message.
static void trace(Object obj, String message)
          Prints info (log4j INFO level) message.
static void trace(Object obj, String message, Throwable ex)
          Prints info (log4j INFO level) message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shared

protected static Debug shared
The shared isntance that is used.

Method Detail

loadConfig

public static void loadConfig()
Loads the config for the log4j.


error

public static void error(Object obj,
                         String message,
                         Throwable ex)
Prints error message. If gui is available, then it show the message in dialog.

Parameters:
obj - message initiator
message - text of error
ex - exception

error

public static void error(Class cls,
                         String message,
                         Throwable ex)
Prints error message. If gui is available, then it show the message in dialog.

Parameters:
cls - message initatior class
message - message text
ex - exception

error

public static void error(Object obj,
                         String message)
Prints error message. If gui is available, then it show the message in dialog.

Parameters:
obj - initiator
message - message text

error

public static void error(Class cls,
                         String message)
Prints error message. If gui is available, then it show the message in dialog.

Parameters:
cls - initiator
message - message text

trace

public static void trace(Object obj,
                         String message)
Prints info (log4j INFO level) message.

Parameters:
obj - initiator
message - info text

trace

public static void trace(Class cls,
                         String message)
Prints info (log4j INFO level) message.

Parameters:
cls - intiator class
message - info text

trace

public static void trace(Object obj,
                         String message,
                         Throwable ex)
Prints info (log4j INFO level) message.

Parameters:
obj - initiator
message - info text
ex - exception

trace

public static void trace(Class cls,
                         String message,
                         Throwable ex)
Prints info (log4j INFO level) message.

Parameters:
cls - initiator class
message - info text
ex - throwed exception

debug

public static void debug(Object obj,
                         String message)
Prints debug (log4j DEBUG level) message.

Parameters:
obj - initiator
message - debug text

debug

public static void debug(Class cls,
                         String message)
Prints debug (log4j DEBUG level) message.

Parameters:
cls - initiator class
message - debug text

debug

public static void debug(Object obj,
                         String message,
                         Throwable ex)
Prints debug (log4j DEBUG level) message.

Parameters:
obj - initiator
message - debug text
ex - throwed exception

debug

public static void debug(Class cls,
                         String message,
                         Throwable ex)
Prints debug (log4j DEBUG level) message.

Parameters:
cls - initiator class
message - debug message
ex - throwed exception