1
0
mirror of https://github.com/rzzzwilson/pymlac.git synced 2025-06-10 09:32:41 +00:00
Files
rzzzwilson.pymlac/vimlac/log.c
2015-10-18 15:34:35 +07:00

34 lines
673 B
C

/*
* Log routines for the imlac simulator.
*/
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
char *LogFile = "vimlac.log";
char *LogPrefix = "";
/******************************************************************************
Description : printf()-style log routine.
Parameters : like printf()
Returns :
Comments :
******************************************************************************/
void
vlog(char *fmt, ...)
{
va_list ap;
char buff[1024];
FILE *fd;
va_start(ap, fmt);
vsprintf(buff, fmt, ap);
fd = fopen(LogFile, "a");
fprintf(fd, "%s: %s\n", LogPrefix, buff);
fclose(fd);
va_end(ap);
}