com.objexcel.util
Class Debug

java.lang.Object
  |
  +--com.objexcel.util.Debug

public final class Debug
extends java.lang.Object

sends debug messages to a file (error.log) and console. Can print a stack trace with each message.


Inner Class Summary
static class Debug.OutputFinalizer
          this class deallocates any Debug resources when its finalize method is called
 
Field Summary
static int BAD
           
static boolean bDebug
           
static boolean bDoAssertDlg
           
static int FATAL
           
static int INFO
           
static int KEYINFO
           
static int TIMING
           
 
Constructor Summary
Debug()
           
 
Method Summary
static boolean assertMsg(boolean b, java.lang.String failedAssertMessage)
          log or pop up a dialog (depending on setup) is b is fase
static boolean assertMsg(boolean b, java.lang.Throwable failedAssertMessage)
          log or pop up a dialog if b is false;
static java.lang.String getErrorDetail(java.lang.String err, java.lang.Throwable e)
          return e's message as well as the err text (usually the context of the exception)
static java.lang.String getPythonErrorInfo(java.lang.Throwable e)
          get info about a PyException derived class.
static Debug.OutputFinalizer initialize(boolean bDeleteErrorLog, java.io.File errorLog)
          for efficiency Debug's methods are static.
static void msg(int level, java.lang.String s)
          log the msg
static void msg(int level, java.lang.String s, java.lang.Throwable e)
          log the msg: s is the context, e is the problem
static void msg(int level, java.lang.Throwable e)
          log the specified message
static java.lang.String stackTraceFromException(java.lang.Exception e)
          get a string stack trace from the given exception
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bDebug

public static final boolean bDebug

bDoAssertDlg

public static final boolean bDoAssertDlg

TIMING

public static final int TIMING

INFO

public static final int INFO

KEYINFO

public static final int KEYINFO

BAD

public static final int BAD

FATAL

public static final int FATAL
Constructor Detail

Debug

public Debug()
Method Detail

initialize

public static Debug.OutputFinalizer initialize(boolean bDeleteErrorLog,
                                               java.io.File errorLog)
for efficiency Debug's methods are static. This method set's up the debug class for output.

msg

public static void msg(int level,
                       java.lang.Throwable e)
log the specified message

msg

public static void msg(int level,
                       java.lang.String s)
log the msg

msg

public static void msg(int level,
                       java.lang.String s,
                       java.lang.Throwable e)
log the msg: s is the context, e is the problem

stackTraceFromException

public static java.lang.String stackTraceFromException(java.lang.Exception e)
get a string stack trace from the given exception

assertMsg

public static boolean assertMsg(boolean b,
                                java.lang.Throwable failedAssertMessage)
log or pop up a dialog if b is false;

assertMsg

public static boolean assertMsg(boolean b,
                                java.lang.String failedAssertMessage)
log or pop up a dialog (depending on setup) is b is fase

getErrorDetail

public static java.lang.String getErrorDetail(java.lang.String err,
                                              java.lang.Throwable e)
return e's message as well as the err text (usually the context of the exception)

getPythonErrorInfo

public static java.lang.String getPythonErrorInfo(java.lang.Throwable e)
get info about a PyException derived class. uses introspection so python libs need not be loaded. The normal python error info is not so readable :(