nuclear@1: #include nuclear@1: #include nuclear@1: #include "logger.h" nuclear@1: nuclear@1: #define LOGFNAME "rayzor.log" nuclear@1: nuclear@1: static FILE *logfile; nuclear@1: nuclear@1: void printlog(const char *fmt, ...) nuclear@1: { nuclear@1: va_list ap; nuclear@1: nuclear@1: if(!logfile) { nuclear@1: if(!(logfile = fopen(LOGFNAME, "w"))) { nuclear@1: return; nuclear@1: } nuclear@1: setvbuf(logfile, 0, _IOLBF, 0); nuclear@1: } nuclear@1: nuclear@1: va_start(ap, fmt); nuclear@1: vfprintf(logfile, fmt, ap); nuclear@1: va_end(ap); nuclear@1: }