rayzor

view src/logger.c @ 1:a826bf0fb169

fixed line endings
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 05 Apr 2014 09:05:26 +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 }