|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.util.D
public class D
Provides some convenience methods for code debugging and exception handling.
The behavior of this class can be adapted by starting
the Java Virtual Machine with a set system property
y.debug
and y.debug.level
.
The default debug level is 2. It can be changed by
setting the system property y.debug.level
appropriately.
Field Summary | |
---|---|
static int |
DEBUG_LEVEL
The debug level threshold. |
Constructor Summary | |
---|---|
D()
|
Method Summary | |
---|---|
static void |
bu(int level,
java.lang.String output)
Like bug(int, String) , but uses no line-feed. |
static void |
bu(java.lang.Object msg)
Like bug(Object) , but omits newline. |
static void |
bu(java.lang.Object source,
java.lang.Object msg)
Like bug(Object, Object) , but does not append a newline to the
output. |
static void |
bug(int level,
java.lang.String msg)
Prints the given string to System.out if
the given debug level if bigger than
DEBUG_LEVEL . |
static void |
bug(java.lang.Object msg)
Prints the given object to System.err unconditionally. |
static void |
bug(java.lang.Object source,
int level,
java.lang.Object msg)
Print the given message to System.err if the fully qualified
class name of the given source object is encoded
in the system property y.debug . |
static void |
bug(java.lang.Object source,
java.lang.Object msg)
Print the given message to System.err if the fully qualified
class name of the given source object is encoded
in the system property y.debug and
if the given debug level if bigger than
DEBUG_LEVEL . |
static void |
fatal(java.lang.Object msg)
Called on a fatal error. |
static void |
fatal(java.lang.Object source,
java.lang.Object msg)
Outputs the class of the given object and the given message. |
static boolean |
isLogToUI()
Returns whether show(Exception) , show(Throwable) , and showError(Object) calls should log
to the UI even if the current Thread is not the EDT. |
static void |
setLogToUI(boolean newLogToUI)
Determines whether show(Exception) , show(Throwable) , and showError(Object) calls
should open a dialog UI even if the current Thread is not the EDT. |
static void |
show(java.lang.Exception ex)
Displays the stack trace generated by the given exception in a dialog window. |
static void |
show(java.lang.Throwable t)
Displays the stack trace generated by the given exception in a dialog window. |
static void |
showError(java.lang.Object obj)
Displays the string representation of the given object in a dialog window. |
static void |
trace()
Outputs a stack trace on System.err. |
static void |
trace(java.lang.Exception ex)
Outputs a stack trace on System.err . |
static boolean |
watch(java.lang.String source)
Returns true if the given object type is under observation due to the -Dy.debug mechanism. |
static boolean |
watchSource(java.lang.Object source)
Returns true if the given object type is under observation due to the -Dy.debug mechanism. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEBUG_LEVEL
y.debug.level
.
Constructor Detail |
---|
public D()
Method Detail |
---|
public static void bug(int level, java.lang.String msg)
System.out
if
the given debug level if bigger than
DEBUG_LEVEL
.
public static void bug(java.lang.Object msg)
System.err
unconditionally.
public static boolean isLogToUI()
show(Exception)
, show(Throwable)
, and showError(Object)
calls should log
to the UI even if the current Thread is not the EDT.
public static void setLogToUI(boolean newLogToUI)
show(Exception)
, show(Throwable)
, and showError(Object)
calls
should open a dialog UI even if the current Thread is not the EDT.
newLogToUI
- whether to display the error in a dialog.public static void bu(java.lang.Object msg)
bug(Object)
, but omits newline.
public static void bug(java.lang.Object source, java.lang.Object msg)
System.err
if the fully qualified
class name of the given source object is encoded
in the system property y.debug
and
if the given debug level if bigger than
DEBUG_LEVEL
.
The value of the y.debug
property is a colon separated
list of fully qualified class name prefixes. If the name of the given
class starts with one of the specified prefixes the debug message will
be printed to System.err
.
public static void bug(java.lang.Object source, int level, java.lang.Object msg)
System.err
if the fully qualified
class name of the given source object is encoded
in the system property y.debug
.
The value of the y.debug
property is a colon separated
list of fully qualified class name prefixes. If the name of the given
class starts with one of the specified prefixes the debug message will
be printed to System.err
.
public static void bu(java.lang.Object source, java.lang.Object msg)
bug(Object, Object)
, but does not append a newline to the
output.
public static boolean watchSource(java.lang.Object source)
-Dy.debug
mechanism.
public static boolean watch(java.lang.String source)
-Dy.debug
mechanism.
public static void fatal(java.lang.Object source, java.lang.Object msg)
public static void fatal(java.lang.Object msg)
public static void bu(int level, java.lang.String output)
bug(int, String)
, but uses no line-feed.
public static void trace(java.lang.Exception ex)
System.err
.
public static void trace()
System.err.
public static void showError(java.lang.Object obj)
public static void show(java.lang.Exception ex)
public static void show(java.lang.Throwable t)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |