- port to Cygwin (DLL support, etc.)
[citadel.git] / citadel / logging.c
1 /*
2  * $Id$
3  *
4  * Everything which needs some logging...
5  *
6  */
7
8 #ifdef DLL_EXPORT
9 #define IN_LIBCIT
10 #endif
11
12 #include "sysdep.h"
13 #include <stdlib.h>
14 #include <unistd.h>
15 #include <stdio.h>
16 #include <fcntl.h>
17 #include <signal.h>
18
19 #if TIME_WITH_SYS_TIME
20 # include <sys/time.h>
21 # include <time.h>
22 #else
23 # if HAVE_SYS_TIME_H
24 #  include <sys/time.h>
25 # else
26 #  include <time.h>
27 # endif
28 #endif
29
30 #include <ctype.h>
31 #include <string.h>
32 #include <errno.h>
33 #include <syslog.h>
34 #include "citadel.h"
35 #include "server.h"
36 #include "logging.h"
37
38
39 void rec_log(unsigned int lrtype, char *name) {
40         FILE *fp;
41         time_t now;
42
43         time(&now);
44         fp = fopen("citadel.log", "a");
45         if (fp != NULL) {
46                 fprintf(fp, "%ld|%u|%s\n", (long)now, lrtype, name);
47                 fclose(fp);
48         }
49 }