Mercurial > dwindows
diff template/dw.c @ 1306:dbd507f42947
Added dw_debug() logging function which will output a message to the debugging console.
On Windows this uses OutputDebugMessage(), on Mac it uses NSLog() ...
The other platforms currently just dump it to stderr. Maybe more enhancements to come.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 03 Nov 2011 23:34:10 +0000 |
parents | b99b0b2c2826 |
children | 896347a9be19 |
line wrap: on
line diff
--- a/template/dw.c Thu Nov 03 10:09:11 2011 +0000 +++ b/template/dw.c Thu Nov 03 23:34:10 2011 +0000 @@ -480,6 +480,24 @@ } /* + * Displays a debug message on the console... + * Parameters: + * format: printf style format string. + * ...: Additional variables for use in the format. + */ +void API dw_debug(char *format, ...) +{ + va_list args; + char outbuf[1025] = {0}; + + va_start(args, format); + vsnprintf(outbuf, 1024, format, args); + va_end(args); + + fprintf(stderr, "%s", outbuf); +} + +/* * Displays a Message Box with given text and title.. * Parameters: * title: The title of the message box.