facets.util
Class Debug

java.lang.Object
  extended by facets.util.Debug

public final class Debug
extends java.lang.Object

Utilities for use during development.


Field Summary
static int HASH_MASK
           
static boolean mbAsKb
           
static boolean memCheck
           
static boolean natureDebug
          Global flag.
 
Constructor Summary
Debug()
           
 
Method Summary
static java.lang.String arrayInfo(java.lang.Object[] array)
          Returns an array of infos.
static java.lang.String exceptionInfo(java.lang.Exception e, java.lang.String title)
           
static java.lang.Thread[] getSortedThreads()
           
static java.lang.String id(java.lang.Object object)
          A value that uniquely identifies the object within its class.
static java.lang.String info(java.lang.Object o)
          Returns basic information about an object's type and identity.
static java.lang.String mb(long bytes)
           
static void memCheck(java.lang.String header, boolean withGc)
           
static java.lang.String parseStackTrace(int stopLines, java.lang.String stopText, boolean noLinks)
           
static void printStackTrace(int printLines)
          Prints a useful,truncated stack trace.
static void printStackTrace(java.lang.String stopText)
          Prints useful stack trace up to eg a method name.
static void printThisTrace(java.lang.Object src, int printLines)
           
static void printThisTrace(java.lang.Object src, java.lang.String stopText)
           
static java.lang.String[] readTraceLines(java.lang.Throwable t, int stopLines, java.lang.String stopText, int omitLines)
           
static java.lang.String[] stackTraceLines(java.lang.Throwable t)
           
static void trapCall()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HASH_MASK

public static final int HASH_MASK
See Also:
Constant Field Values

memCheck

public static boolean memCheck

mbAsKb

public static boolean mbAsKb

natureDebug

public static boolean natureDebug
Global flag.

Constructor Detail

Debug

public Debug()
Method Detail

getSortedThreads

public static java.lang.Thread[] getSortedThreads()

mb

public static java.lang.String mb(long bytes)

exceptionInfo

public static java.lang.String exceptionInfo(java.lang.Exception e,
                                             java.lang.String title)

id

public static java.lang.String id(java.lang.Object object)
A value that uniquely identifies the object within its class.

Returns:
where available Identified.identity(), otherwise the truncated Object.hashCode().

info

public static java.lang.String info(java.lang.Object o)
Returns basic information about an object's type and identity.

This will be some combination of


arrayInfo

public static java.lang.String arrayInfo(java.lang.Object[] array)
Returns an array of infos.


stackTraceLines

public static java.lang.String[] stackTraceLines(java.lang.Throwable t)

printStackTrace

public static void printStackTrace(int printLines)
Prints a useful,truncated stack trace.

Parameters:
printLines - how many lines of the trace to print

printStackTrace

public static void printStackTrace(java.lang.String stopText)
Prints useful stack trace up to eg a method name.

Parameters:
stopText - occurring in a line stops further lines appearing

printThisTrace

public static void printThisTrace(java.lang.Object src,
                                  int printLines)

printThisTrace

public static void printThisTrace(java.lang.Object src,
                                  java.lang.String stopText)

readTraceLines

public static java.lang.String[] readTraceLines(java.lang.Throwable t,
                                                int stopLines,
                                                java.lang.String stopText,
                                                int omitLines)

parseStackTrace

public static java.lang.String parseStackTrace(int stopLines,
                                               java.lang.String stopText,
                                               boolean noLinks)

trapCall

public static void trapCall()

memCheck

public static void memCheck(java.lang.String header,
                            boolean withGc)