comparison 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
comparison
equal deleted inserted replaced
1305:18a31ab94e3d 1306:dbd507f42947
478 } 478 }
479 return _user_dir; 479 return _user_dir;
480 } 480 }
481 481
482 /* 482 /*
483 * Displays a debug message on the console...
484 * Parameters:
485 * format: printf style format string.
486 * ...: Additional variables for use in the format.
487 */
488 void API dw_debug(char *format, ...)
489 {
490 va_list args;
491 char outbuf[1025] = {0};
492
493 va_start(args, format);
494 vsnprintf(outbuf, 1024, format, args);
495 va_end(args);
496
497 fprintf(stderr, "%s", outbuf);
498 }
499
500 /*
483 * Displays a Message Box with given text and title.. 501 * Displays a Message Box with given text and title..
484 * Parameters: 502 * Parameters:
485 * title: The title of the message box. 503 * title: The title of the message box.
486 * flags: flags to indicate buttons and icon 504 * flags: flags to indicate buttons and icon
487 * format: printf style format string. 505 * format: printf style format string.