Changeset 202:1d129e5f6aa6

Show
Ignore:
Timestamp:
04/12/08 11:50:15 (6 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

extend PrintStackTrace?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/dwthelper/utils.d

    r201 r202  
    930930} 
    931931 
    932 void PrintStackTrace(){ 
    933     try{ 
    934         throw new Exception( null ); 
    935     } 
    936     catch( Exception e ){ 
    937         foreach( msg; e.info ){ 
    938             Trace.formatln( "trc: {}", msg ); 
    939         } 
     932void PrintStackTrace( int deepth = 100, char[] prefix = "trc" ){ 
     933    auto e = new Exception( null ); 
     934    int idx = 0; 
     935    const start = 3; 
     936    foreach( msg; e.info ){ 
     937        if( idx >= start && idx < start+deepth ) { 
     938            Trace.formatln( "{}: {}", prefix, msg ); 
     939        } 
     940        idx++; 
    940941    } 
    941942}