de.enough.polish.util
Class Debug

java.lang.Object
  extended by de.enough.polish.util.Debug
All Implemented Interfaces:
CommandListener

public final class Debug
extends Object
implements CommandListener

Is used for debugging of information.

Copyright Enough Software 2004 - 2009

 history
        20-Jan-2003 - rob creation
 

Author:
Robert Virkus, robert@enough.de

Field Summary
static Command RETURN_COMMAND
           
static boolean suppressMessages
           
 
Constructor Summary
Debug()
           
 
Method Summary
static void clearLog()
          Clears the log messages from MESSAGES.
 void commandAction(Command cmd, Displayable screen)
           
static void debug(String level, String className, int lineNumber, Object message)
          Prints the message or adds the message to the internal message list.
static void debug(String level, String className, int lineNumber, Object message, boolean value)
          Prints a message.
static void debug(String level, String className, int lineNumber, Object message, byte value)
          Prints a message.
static void debug(String level, String className, int lineNumber, Object message, char value)
          Prints a message.
static void debug(String level, String className, int lineNumber, Object message, int value)
          Prints a message.
static void debug(String level, String className, int lineNumber, Object message, long value)
          Prints a message.
static void debug(String level, String className, int lineNumber, Object message, Object exception)
          Prints a message.
static void debug(String level, String className, int lineNumber, Object message, short value)
          Prints a message.
static void debug(String level, String className, int lineNumber, Object message, Throwable exception)
          Prints a message.
static void debug(String level, String className, int lineNumber, Throwable exception)
          Logs the given exception.
static void exit()
           
static Form getLogForm(boolean reverseSort, CommandListener listener)
          Deprecated. use showLogForm instead
static void showLog(Display display)
          Shows the log with the current messages.
static void showLog(Display display)
          Shows the log with the current messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

suppressMessages

public static boolean suppressMessages

RETURN_COMMAND

public static final Command RETURN_COMMAND
Constructor Detail

Debug

public Debug()
Method Detail

clearLog

public static void clearLog()
Clears the log messages from MESSAGES. showLog() must be called again


debug

public static void debug(String level,
                         String className,
                         int lineNumber,
                         Object message,
                         Object exception)
Prints a message.

Parameters:
level - the log level, e.g. "debug"
className - the name of the class
lineNumber - the line numer of the log statement
message - the message.
exception - the exception or just an ordinary object

debug

public static void debug(String level,
                         String className,
                         int lineNumber,
                         Object message,
                         char value)
Prints a message. This method should not be used directly.

Parameters:
level - the log level, e.g. "debug"
className - the name of the class
lineNumber - the line numer of the log statement
message - the message.
value - the char value

debug

public static void debug(String level,
                         String className,
                         int lineNumber,
                         Object message,
                         int value)
Prints a message. This method should not be used directly.

Parameters:
level - the log level, e.g. "debug"
className - the name of the class
lineNumber - the line numer of the log statement
message - the message.
value - the int value

debug

public static void debug(String level,
                         String className,
                         int lineNumber,
                         Object message,
                         long value)
Prints a message. This method should not be used directly.

Parameters:
level - the log level, e.g. "debug"
className - the name of the class
lineNumber - the line numer of the log statement
message - the message.
value - the long value

debug

public static void debug(String level,
                         String className,
                         int lineNumber,
                         Object message,
                         short value)
Prints a message. This method should not be used directly.

Parameters:
level - the log level, e.g. "debug"
className - the name of the class
lineNumber - the line numer of the log statement
message - the message.
value - the short value

debug

public static void debug(String level,
                         String className,
                         int lineNumber,
                         Object message,
                         byte value)
Prints a message. This method should not be used directly.

Parameters:
level - the log level, e.g. "debug"
className - the name of the class
lineNumber - the line numer of the log statement
message - the message.
value - the byte value

debug

public static void debug(String level,
                         String className,
                         int lineNumber,
                         Object message,
                         boolean value)
Prints a message. This method should not be used directly.

Parameters:
level - the log level, e.g. "debug"
className - the name of the class
lineNumber - the line numer of the log statement
message - the message.
value - the boolean value

debug

public static void debug(String level,
                         String className,
                         int lineNumber,
                         Object message)
Prints the message or adds the message to the internal message list.

Parameters:
level - the log level, e.g. "debug"
className - the name of the class
lineNumber - the line numer of the log statement
message - the message.

debug

public static void debug(String level,
                         String className,
                         int lineNumber,
                         Throwable exception)
Logs the given exception.

Parameters:
level - the log level, e.g. "debug"
className - the name of the class
lineNumber - the line numer of the log statement
exception - the exception which was catched.

debug

public static void debug(String level,
                         String className,
                         int lineNumber,
                         Object message,
                         Throwable exception)
Prints a message.

Parameters:
level - the log level, e.g. "debug"
className - the name of the class
lineNumber - the line numer of the log statement
message - the message.
exception - the exception

getLogForm

public static Form getLogForm(boolean reverseSort,
                              CommandListener listener)
Deprecated. use showLogForm instead

Retrieves a form with all the debugging messages.

Parameters:
reverseSort - true when the last message should be shown first
listener - the command listener for the created form
Returns:
the form containing all the debugging messages so far.
Throws:
NullPointerException - when the listener is null
See Also:
showLog(Display)

showLog

public static void showLog(Display display)
Shows the log with the current messages. When new messages are added, the log will be updated. The latest messages will be at the top.

Parameters:
display - the display-variable for the current MIDlet.

showLog

public static void showLog(Display display)
Shows the log with the current messages. When new messages are added, the log will be updated. The latest messages will be at the top.

Parameters:
display - the display-variable for the current MIDlet.

commandAction

public void commandAction(Command cmd,
                          Displayable screen)
Specified by:
commandAction in interface CommandListener

exit

public static void exit()