rayzor

view src/logger.c @ 2:c273c6f799a4

added fixcase utility to fix the ftp-ed files' case on linux
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 05 Apr 2014 18:31:00 +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 }