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

37 lines
498 B
C
Raw Normal View History

/*
error.c --
Error logging
*/
2008-08-07 14:43:17 +02:00
2008-08-21 22:34:00 +02:00
#include "osd.h"
2008-08-07 14:43:17 +02:00
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:43:17 +02:00
}
void error_shutdown(void)
{
2008-08-21 22:34:00 +02:00
if(error_log) fclose(error_log);
2008-08-07 14:43:17 +02:00
}
void error(char *format, ...)
{
2008-08-21 22:34:00 +02:00
if (!log_error) return;
va_list ap;
va_start(ap, format);
if(error_log) vfprintf(error_log, format, ap);
va_end(ap);
2008-08-07 14:43:17 +02:00
}