Genesis-Plus-GX/source/unused/dos/error.c

33 lines
454 B
C
Raw Normal View History

2008-08-07 14:26:07 +02:00
#include "osd.h"
FILE *error_log;
struct {
int enabled;
int verbose;
FILE *log;
} t_error;
void error_init(void)
{
#ifdef LOG_ERROR
2008-08-21 22:34:00 +02:00
error_log = fopen("error.log","w");
#endif
2008-08-07 14:26:07 +02:00
}
void error_shutdown(void)
{
2008-08-21 22:34:00 +02:00
if(error_log) fclose(error_log);
2008-08-07 14:26:07 +02:00
}
void error(char *format, ...)
{
if (!log_error) return;
va_list ap;
2008-08-21 22:34:00 +02:00
va_start(ap, format);
if(error_log) vfprintf(error_log, format, ap);
va_end(ap);
2008-08-07 14:26:07 +02:00
}