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)
|
|
|
|
{
|
2008-08-25 21:38:03 +02:00
|
|
|
#ifdef LOG_ERROR
|
2008-08-21 22:34:00 +02:00
|
|
|
error_log = fopen("error.log","w");
|
2008-08-25 21:38:03 +02:00
|
|
|
#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
|
|
|
}
|
|
|
|
|