Mercurial > projects > dwt-win
comparison dwt/dwthelper/utils.d @ 202:1d129e5f6aa6
extend PrintStackTrace
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 12 Apr 2008 17:50:15 +0200 |
parents | 6293c40673a4 |
children | cca980503056 |
comparison
equal
deleted
inserted
replaced
201:6293c40673a4 | 202:1d129e5f6aa6 |
---|---|
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; |