aboutsummaryrefslogtreecommitdiff
path: root/src/weblog.c
blob: 2d8921795d9c29fb78ee61c5d8599f32dda12fb1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved. 
 *
 * See the LICENSE file
 *
 * The origin of this software must not be misrepresented, either by
 * explicit claim or by omission.  Since few users ever read sources,
 * credits must appear in the documentation.
 *
 * date: Sat Mar 30 14:44:42 GMT 2002
 *
 * -- web_log operations
 *
 */



#include "weblog.h"

FILE *_logfile=NULL;
/*********************************************************************************************************/
/*
 * Open weblog file
 */
FILE *open_weblog(const char *logfile) {
	FILE *ret;
	ret=fopen(logfile,"a+");
	_logfile=ret;
	return ret;
}

/*********************************************************************************************************/
/*
 * Log to _logfile;
 */
void web_log(const char *fmt,...) {
	va_list args;
	if(_logfile) {
		va_start(args,fmt);
		vfprintf(_logfile,fmt,args);
		va_end(args);
		fflush(_logfile);
	}
}