Changeset 202:1d129e5f6aa6
- 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
| r201 |
r202 |
|
| 930 | 930 | } |
|---|
| 931 | 931 | |
|---|
| 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 | | } |
|---|
| | 932 | void 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++; |
|---|
| 940 | 941 | } |
|---|
| 941 | 942 | } |
|---|