win32-gui: use showdebug() to control nhtrace logging
This commit is contained in:
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
extern winid WIN_STATUS;
|
extern winid WIN_STATUS;
|
||||||
|
|
||||||
|
#define NHTRACE_LOG "nhtrace.log"
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
extern void logDebug(const char *fmt, ...);
|
extern void logDebug(const char *fmt, ...);
|
||||||
#else
|
#else
|
||||||
@@ -158,9 +160,10 @@ void mswin_init_nhwindows(int* argc, char** argv)
|
|||||||
logDebug("mswin_init_nhwindows()\n");
|
logDebug("mswin_init_nhwindows()\n");
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
if (showdebug(NHTRACE_LOG))
|
||||||
{
|
{
|
||||||
/* truncate trace file */
|
/* truncate trace file */
|
||||||
FILE *dfp = fopen("nhtrace.log", "w");
|
FILE *dfp = fopen(NHTRACE_LOG, "w");
|
||||||
fclose(dfp);
|
fclose(dfp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -2147,8 +2150,11 @@ void mswin_popup_destroy(HWND hWnd)
|
|||||||
void
|
void
|
||||||
logDebug(const char *fmt, ...)
|
logDebug(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
FILE *dfp = fopen("nhtrace.log", "a");
|
FILE *dfp;
|
||||||
|
|
||||||
|
if (!showdebug(NHTRACE_LOG)) return;
|
||||||
|
|
||||||
|
dfp = fopen(NHTRACE_LOG, "a");
|
||||||
if (dfp) {
|
if (dfp) {
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user