| java.lang.Object org.netbeans.modules.visualweb.extension.openide.util.TraceBase org.netbeans.modules.visualweb.extension.openide.util.Trace
All known Subclasses: org.netbeans.modules.visualweb.extension.openide.util.TraceUI,
Trace | public class Trace extends TraceBase (Code) | | Used for logging output to help debug netbeans modules. Debug messages
are logged into a specific category which must be "enabled" in order for
the output to make it to the console or logger.
The trace messages all return true (always). This makes them suitable
as assertions - to take advantage of the conditional processing of
assertions. E.g "assert Trace.trace(compute());". Here the Trace call
will only be processed (and its arguments evaluated) when assertions
are enabled. Obviously you must run with assertions enabled if you
use the Trace library this way.
author: Joe Nuxoll |
Field Summary | |
public static int | counter This is a global counter variable that is handy to use when tracing
repetitive tasks. | public static PrintStream | out |
Method Summary | |
public static void | disableTraceCategory(String category) | public static void | disableTraceCategory(Class category) | public static void | enableTraceCategory(String category) | public static void | enableTraceCategory(Class category) | public static boolean | flush() | public static boolean | isOutputEnabled() | public static boolean | printStackTrace() Prints a stack trace of the current thread to the Trace.out stream. | public static boolean | printStackTrace(Throwable t) Prints the specified exception stack trace to the Trace.out stream. | public static void | setOutputEnabled(boolean enabled) | public static void | setOutputStream(PrintStream log) Sets the output stream to be used for tracing. | public static boolean | trace(String category, String message) | public static boolean | trace(Class category, String message) | public static boolean | trace(String category, Throwable t) | public static boolean | trace(Class category, Throwable t) | public static boolean | warnTrace(String category, boolean condition, String message) | public static boolean | warnTrace(Class category, boolean condition, String message) | public static boolean | warnTrace(String category, String message) | public static boolean | warnTrace(Class category, String message) |
counter | public static int counter(Code) | | This is a global counter variable that is handy to use when tracing
repetitive tasks.
|
disableTraceCategory | public static void disableTraceCategory(String category)(Code) | | Disables tracing for the specified category of messages
Parameters: category - Remove specified category to disable tracing |
disableTraceCategory | public static void disableTraceCategory(Class category)(Code) | | Disables tracing for the specified category of messages
Parameters: category - Remove specified category to disable tracing |
enableTraceCategory | public static void enableTraceCategory(String category)(Code) | | This enables tracing for the specified category of messages
Parameters: category - Enable tracing of this category |
enableTraceCategory | public static void enableTraceCategory(Class category)(Code) | | This enables tracing for the specified category of messages
Parameters: category - Enable tracing of this category |
flush | public static boolean flush()(Code) | | Flushes the Trace.out stream
true |
isOutputEnabled | public static boolean isOutputEnabled()(Code) | | |
printStackTrace | public static boolean printStackTrace()(Code) | | Prints a stack trace of the current thread to the Trace.out stream.
true |
printStackTrace | public static boolean printStackTrace(Throwable t)(Code) | | Prints the specified exception stack trace to the Trace.out stream.
Parameters: t - Source Throwable to print a stack trace from true |
setOutputEnabled | public static void setOutputEnabled(boolean enabled)(Code) | | turns on/off tracing for all categories
Parameters: enabled - true to enable tracing, false to disable it |
setOutputStream | public static void setOutputStream(PrintStream log)(Code) | | Sets the output stream to be used for tracing. This will
assign the static Trace.out variable.
Parameters: log - The PrintStream to use for Trace.out |
trace | public static boolean trace(String category, String message)(Code) | | Sends a message to Trace.out if the category is enabled and global output is enabled
Parameters: category - Category to which this message belongs Parameters: message - Message to print if the category is enabled true |
trace | public static boolean trace(Class category, String message)(Code) | | Sends a message to Trace.out if the category is enabled and global output is enabled
Parameters: category - Category to which this message belongs Parameters: message - Message to print if the category is enabled true |
trace | public static boolean trace(String category, Throwable t)(Code) | | Prints a stack trace to Trace.out if the category is enabled and global output is enabled
Parameters: category - Category to which this message belongs Parameters: t - Throwable for stack trace to print true |
trace | public static boolean trace(Class category, Throwable t)(Code) | | Prints a stack trace to Trace.out if the category is enabled and global output is enabled
Parameters: category - Category to which this message belongs Parameters: t - Throwable for stack trace to print true |
warnTrace | public static boolean warnTrace(String category, boolean condition, String message)(Code) | | Print the specified text to Trace.out if the specified category is enabled, and specified
condition evaluates to true, and global output is enabled
Parameters: category - Category to which this message belongs Parameters: condition - If this evaluates to true, the message will be printed Parameters: message - Message to print if the category is enabled and the condition evals to true true |
warnTrace | public static boolean warnTrace(Class category, boolean condition, String message)(Code) | | Prints the specified message to Trace.out if the specified category is enabled and specified
condition evaluates to true, and global output is enabled
Parameters: category - Category to which this message belongs Parameters: condition - If this evaluates to true, the message will be printed Parameters: message - Message to print if the category is enabled and the condition evals to true true |
warnTrace | public static boolean warnTrace(String category, String message)(Code) | | Prints the specified message to Trace.out if the specified category is enabled and global
output is enabled
Parameters: category - Category to which this message belongs Parameters: message - Message to print if the category is enabled true |
warnTrace | public static boolean warnTrace(Class category, String message)(Code) | | Prints the specified message to Trace.out if the specified category is enabled and global
output is enabled
Parameters: category - Category to which this message belongs Parameters: message - Message to print if the category is enabled true |
Fields inherited from org.netbeans.modules.visualweb.extension.openide.util.TraceBase | final public static boolean OFF(Code)(Java Doc) final public static boolean ON(Code)(Java Doc)
|
|
|