Changeset 5670


Ignore:
Timestamp:
11/04/09 16:39:24 (10 years ago)
Author:
curtis
Message:

Add convenience method for getting stack trace string.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/common/src/loci/common/Log.java

    r5151 r5670  
    8484  public void trace(String s) { trace(new Exception(s)); } 
    8585  public void trace(Throwable t) { 
     86    println(getStackTrace(t)); 
     87  } 
     88 
     89  // -- Static utility methods -- 
     90 
     91  public static String getStackTrace(Throwable t) { 
    8692    ByteArrayOutputStream baos = new ByteArrayOutputStream(); 
    8793    t.printStackTrace(new PrintStream(baos)); 
    88     println(baos); 
     94    return baos.toString(); 
    8995  } 
    9096 
Note: See TracChangeset for help on using the changeset viewer.