rayzor

view src/logger.c @ 5:5fcf72837b69

fixed the dosemu bit
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 06 Apr 2014 02:43:24 +0300
parents 2a5340a6eee4
children a68dbf80d547
line source
1 #include <stdio.h>
2 #include <stdarg.h>
3 #include "logger.h"
5 #define LOGFNAME "rayzor.log"
7 static FILE *logfile;
9 void printlog(const char *fmt, ...)
10 {
11 va_list ap;
13 if(!logfile) {
14 if(!(logfile = fopen(LOGFNAME, "w"))) {
15 return;
16 }
17 setvbuf(logfile, 0, _IOLBF, 0);
18 }
20 va_start(ap, fmt);
21 vfprintf(logfile, fmt, ap);
22 va_end(ap);
23 }