Just testing out this handy sounding utility: StackTraceUtils.

First, the printSanitizedStackTrace does not print the same as the remaining 
trace after the sanitize method.  What is it meant to print?
Second, the StackTraceUtils.addClassTest is obviously global - but there does 
not seem to be a way to clear or modify the test list.  Perhaps not important - 
but when playing with the method in groovyConsole it simply keeps adding to the 
previous tests!

Test example...

...some errorble code here...
} catch(e) {
 println e
//  e.printStackTrace()  //uncomment to see the whole stack

 println 'sanitized 1'
//  PrintWriter writer = new PrintWriter(System.out);
//  StackTraceUtils.printSanitizedStackTrace(e, writer) //this outputs nothing
 StackTraceUtils.printSanitizedStackTrace(e)  //this prints nothing too

 println 'sanitized 2'
 StackTraceUtils.sanitize(e)
 e.printStackTrace()  //this is good, and prints the expected non-groovy stack
}

Merlin Beedell

Reply via email to