new scrapple Lib: API logging
BCS
ao at pathlink.com
Wed Aug 13 11:54:31 PDT 2008
(lets try this again in the correct NG :)
I have posted a new library to scrapple.
http://www.dsource.org/projects/scrapple/browser/trunk/log_api
This library allows simple wrapping of function calls with logging of file
name/line number of call, function name and argument/return values.
The intended use for this lib is for debugging the external API's. For example
I wrote it because I was having issues with a mysql wrapper lib and wanted
to known what api calls were being made.
To use it, replace the calls to be logged with wrapped calls:
ulong r = mysql_real_escape_string(connection, ret.ptr, string.ptr, string.length);
ulong r = TraceAPI!("mysql_real_escape_string)(__FILE__,__LINE__,connection,
ret.ptr, string.ptr, string.length);
a little fun with regex and you can have a whole file done in about a minute
More information about the Digitalmars-d-announce
mailing list