comparison dwt/dwthelper/utils.d @ 229:d02819f051cc

extend PrintStackTrace
author Frank Benoit <benoit@tionex.de>
date Sat, 12 Apr 2008 17:49:18 +0200
parents a8304c57f9d8
children b16e1f78a213
comparison
equal deleted inserted replaced
228:a8304c57f9d8 229:d02819f051cc
927 idx++; 927 idx++;
928 } 928 }
929 return res; 929 return res;
930 } 930 }
931 931
932 void PrintStackTrace(){ 932 void PrintStackTrace( int deepth = 100, char[] prefix = "trc" ){
933 try{ 933 auto e = new Exception( null );
934 throw new Exception( null ); 934 int idx = 0;
935 } 935 const start = 3;
936 catch( Exception e ){ 936 foreach( msg; e.info ){
937 foreach( msg; e.info ){ 937 if( idx >= start && idx < start+deepth ) {
938 Trace.formatln( "trc: {}", msg ); 938 Trace.formatln( "{}: {}", prefix, msg );
939 } 939 }
940 idx++;
940 } 941 }
941 } 942 }
942 943
943 struct ImportData{ 944 struct ImportData{
944 void[] data; 945 void[] data;