diff options
Diffstat (limited to 'src/weblog.c')
-rw-r--r-- | src/weblog.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/weblog.c b/src/weblog.c new file mode 100644 index 00000000..2d892179 --- /dev/null +++ b/src/weblog.c | |||
@@ -0,0 +1,43 @@ | |||
1 | /* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved. | ||
2 | * | ||
3 | * See the LICENSE file | ||
4 | * | ||
5 | * The origin of this software must not be misrepresented, either by | ||
6 | * explicit claim or by omission. Since few users ever read sources, | ||
7 | * credits must appear in the documentation. | ||
8 | * | ||
9 | * date: Sat Mar 30 14:44:42 GMT 2002 | ||
10 | * | ||
11 | * -- web_log operations | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | |||
16 | |||
17 | #include "weblog.h" | ||
18 | |||
19 | FILE *_logfile=NULL; | ||
20 | /*********************************************************************************************************/ | ||
21 | /* | ||
22 | * Open weblog file | ||
23 | */ | ||
24 | FILE *open_weblog(const char *logfile) { | ||
25 | FILE *ret; | ||
26 | ret=fopen(logfile,"a+"); | ||
27 | _logfile=ret; | ||
28 | return ret; | ||
29 | } | ||
30 | |||
31 | /*********************************************************************************************************/ | ||
32 | /* | ||
33 | * Log to _logfile; | ||
34 | */ | ||
35 | void web_log(const char *fmt,...) { | ||
36 | va_list args; | ||
37 | if(_logfile) { | ||
38 | va_start(args,fmt); | ||
39 | vfprintf(_logfile,fmt,args); | ||
40 | va_end(args); | ||
41 | fflush(_logfile); | ||
42 | } | ||
43 | } | ||