| | 2 | /** |
|---|
| | 3 | The intended use for this lib is for debugging the external API's. For example |
|---|
| | 4 | I wrote it because I was having issues with a mysql wrapper lib and wanted to |
|---|
| | 5 | known what api calls were being made. |
|---|
| | 6 | |
|---|
| | 7 | To use it, replace the call to be logged with a wrapped call: |
|---|
| | 8 | |
|---|
| | 9 | ulong r = mysql_real_escape_string(connection, ret.ptr, string.ptr, string.length); |
|---|
| | 10 | ulong r = TraceAPI!("mysql_real_escape_string)(__FILE__,__LINE__,connection, ret.ptr, string.ptr, string.length); |
|---|
| | 11 | |
|---|
| | 12 | a little fun with regex and you can have a whole file done in about a minute |
|---|
| | 13 | |
|---|
| | 14 | This software is distributed without any warranty of any kind and is NOT suitable for any |
|---|
| | 15 | production usage. |
|---|
| | 16 | |
|---|
| | 17 | Author: Benjamin Shropshire shro8822 -> vandals uidaho edu |
|---|
| | 18 | */ |
|---|
| 39 | | debug(runTimeTrace) writef(" %s:%s %s = %s\n",file, line, fn, ret); |
|---|
| | 56 | debug(runTimeTrace) writef(" %s:%s %s = ",file, line, fn); |
|---|
| | 57 | static if(is(R == char*)) |
|---|
| | 58 | writef(`"%s"\n`, ret[0..strlen(ret)]); |
|---|
| | 59 | else static if(is(R : int)) |
|---|
| | 60 | writef("%d\n", ret); |
|---|
| | 61 | else |
|---|
| | 62 | writef("[%s]%s\n", R.stringof,ret); |
|---|