All pastes #67852 Raw Edit

Daniel Marjos

public cpp v1 · immutable
#67852 ·published 2006-06-20 18:10 UTC
rendered paste body
void LogLine(char *formatstring, ...){        /*        Inicio Agregado por daniel        */        char logTimeDate[20];        time_t logNow;        char logFile[128];        time(&logNow);        strftime(logTimeDate,(size_t)19,"%Y%m%d%H%M%S.log",localtime(&logNow));        sprintf(logFile,"dupefile-%s.log",logTimeDate);        /*        Fin Agregado por daniel        */	va_list args;	va_start(args, formatstring);	char msg[1024];	EnterCriticalSection(&CriticalSection);	memset(msg, 0, sizeof(msg));	FILE *theFile=fopen(logFile,"a+");	// Esta es la linea vieja: FILE *logfile = fopen("dupefinder.log", "a+");	_vsnprintf(msg, sizeof(msg), formatstring, args);	fputs(msg, theFile);	fclose(theFile);	LeaveCriticalSection(&CriticalSection);}