mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-11-10 12:55:08 +01:00
40 lines
501 B
C
40 lines
501 B
C
|
/*
|
||
|
error.c --
|
||
|
Error logging
|
||
|
*/
|
||
|
|
||
|
#include "shared.h"
|
||
|
|
||
|
FILE *error_log;
|
||
|
|
||
|
struct {
|
||
|
int enabled;
|
||
|
int verbose;
|
||
|
FILE *log;
|
||
|
} t_error;
|
||
|
|
||
|
void error_init(void)
|
||
|
{
|
||
|
#ifdef DEBUG
|
||
|
error_log = fopen("error.log","w");
|
||
|
#endif
|
||
|
}
|
||
|
|
||
|
void error_shutdown(void)
|
||
|
{
|
||
|
#ifdef DEBUG
|
||
|
if(error_log) fclose(error_log);
|
||
|
#endif
|
||
|
}
|
||
|
|
||
|
void error(char *format, ...)
|
||
|
{
|
||
|
#ifdef DEBUG
|
||
|
va_list ap;
|
||
|
va_start(ap, format);
|
||
|
if(error_log) vfprintf(error_log, format, ap);
|
||
|
va_end(ap);
|
||
|
#endif
|
||
|
}
|
||
|
|