Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Can you reproduce losses on time with movei

Author: Uri Blass

Date: 01:59:34 03/23/04

Go up one level in this thread


On March 23, 2004 at 02:43:31, Aivaras Juzvikas wrote:

>make sure u dont fflush(stdin), this was my bug and the symptoms were the same.
>its ok to only fflush(stdout)

I do not know what is the problem and I think that I will simply write more
information in the logfile including information about the line of the code
and the file of the code that the program was in it when I wrote information to
the logfile and in case of writing only to the logfile I will add words only log
file.

I only fflush stdout or fflush my logfile



Here are the log functions that I use when I did not change them since version
178

#include "defs.h"
#include "data.h"
#include "stdarg.h"
void InitLog()
{
	if (g_bLogging)
	{
		strcpy(logstring,"moveloginfo178.log");
		logmovei=fopen(logstring, "a+t");
	}
}
void shutdownengine(int return_code)
{
	if (g_bLogging)
	fclose(logmovei);
	exit(return_code);
}
void __cdecl PrintLog(const char *szFormat, ...)
{

    va_list vargs;
    va_start(vargs, szFormat);
	if (g_bLogging && logmovei != (FILE *)NULL)
	{
        vfprintf(logmovei, szFormat, vargs);
        fflush(logmovei);
    }

    va_end(vargs);
}
void __cdecl Print(const char *szFormat, ...)
{
    va_list vargs;
    va_start(vargs, szFormat);
    vprintf(szFormat, vargs);
    fflush(stdout);

    if (g_bLogging && logmovei != (FILE *)NULL)
    {
        vfprintf(logmovei, szFormat, vargs);
        fflush(logmovei);
    }

    va_end(vargs);
}



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.