Mercurial > masqmail
annotate src/log.c @ 359:84e6b552f6ad
minor refactoring
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Sun, 04 Sep 2011 17:40:13 +0200 |
parents | e507c854a63e |
children | b27f66555ba8 |
rev | line source |
---|---|
0 | 1 /* MasqMail |
2 Copyright (C) 1999-2001 Oliver Kurth | |
3 | |
4 This program is free software; you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 2 of the License, or | |
7 (at your option) any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program; if not, write to the Free Software | |
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
17 */ | |
18 | |
15 | 19 #include <sysexits.h> |
0 | 20 |
15 | 21 #include "masqmail.h" |
0 | 22 |
23 static char *_sysexit_strings[] = { | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
24 "command line usage error", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
25 "data format error", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
26 "cannot open input", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
27 "addressee unknown", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
28 "host name unknown", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
29 "service unavailable", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
30 "internal software error", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
31 "system error (e.g., can't fork)", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
32 "critical OS file missing", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
33 "can't create (user) output file", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
34 "input/output error", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
35 "temp failure; user is invited to retry", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
36 "remote error in protocol", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
37 "permission denied", |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
38 "configuration error" |
0 | 39 }; |
40 | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
41 gchar* |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
42 ext_strerror(int err) |
0 | 43 { |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
44 if (err < 1024) |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
45 return strerror(err); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
46 else if (err > 1024 + EX__BASE |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
47 && (err - 1024 - EX__BASE < sizeof(_sysexit_strings) / sizeof(_sysexit_strings[0]))) |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
48 return _sysexit_strings[err - 1024 - EX__BASE]; |
0 | 49 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
50 return "unknown error"; |
0 | 51 } |
52 | |
53 static FILE *logfile = NULL; | |
54 static FILE *debugfile = NULL; | |
55 | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
56 gboolean |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
57 logopen() |
0 | 58 { |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
59 gchar *filename; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
60 mode_t saved_mode = umask(066); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
61 |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
62 if (conf.use_syslog) { |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
63 openlog(PACKAGE, LOG_PID, LOG_MAIL); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
64 } else { |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
65 uid_t saved_uid; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
66 gid_t saved_gid; |
0 | 67 |
331
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
68 if (!conf.run_as_user) { |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
69 set_euidgid(conf.mail_uid, conf.mail_gid, &saved_uid, &saved_gid); |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
70 } |
0 | 71 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
72 filename = g_strdup_printf("%s/masqmail.log", conf.log_dir); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
73 logfile = fopen(filename, "a"); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
74 if (!logfile) { |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
75 fprintf(stderr, "could not open log '%s': %s\n", filename, strerror(errno)); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
76 return FALSE; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
77 } |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
78 g_free(filename); |
0 | 79 |
331
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
80 if (!conf.run_as_user) { |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
81 set_euidgid(saved_uid, saved_gid, NULL, NULL); |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
82 } |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
83 } |
0 | 84 |
85 #ifdef ENABLE_DEBUG | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
86 if (conf.debug_level > 0) { |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
87 filename = g_strdup_printf("%s/debug.log", conf.log_dir); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
88 debugfile = fopen(filename, "a"); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
89 if (!debugfile) { |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
90 fprintf(stderr, "could not open debug log '%s'\n", filename); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
91 return FALSE; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
92 } |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
93 g_free(filename); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
94 } |
0 | 95 #endif |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
96 umask(saved_mode); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
97 return TRUE; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
98 } |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
99 |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
100 void |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
101 logclose() |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
102 { |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
103 if (conf.use_syslog) |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
104 closelog(); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
105 else if (logfile) |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
106 fclose(logfile); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
107 if (debugfile) |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
108 fclose(debugfile); |
0 | 109 } |
110 | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
111 void |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
112 vlogwrite(int pri, const char *fmt, va_list args) |
0 | 113 { |
15 | 114 if ((conf.do_verbose && (pri & LOG_VERBOSE)) || (pri == LOG_ALERT) || (pri == LOG_WARNING)) { |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
115 va_list args_copy; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
116 va_copy(args_copy, args); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
117 vfprintf(stdout, fmt, args_copy); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
118 va_end(args_copy); |
331
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
119 fflush(stdout); /* in case output ends not with newline */ |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
120 } |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
121 |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
122 pri &= ~LOG_VERBOSE; |
331
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
123 if (!pri) { |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
124 return; |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
125 } |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
126 if (conf.use_syslog) |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
127 vsyslog(pri, fmt, args); |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
128 else if (pri <= conf.log_max_pri) { |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
129 FILE *file = logfile ? logfile : stderr; |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
130 time_t now = time(NULL); |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
131 struct tm *t = localtime(&now); |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
132 gchar buf[24]; |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
133 |
331
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
134 strftime(buf, 24, "%Y-%m-%d %H:%M:%S", t); |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
135 fprintf(file, "%s [%d] ", buf, getpid()); |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
136 |
331
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
137 vfprintf(file, fmt, args); |
e507c854a63e
Security fix! Correct handling of seteuid() return value
markus schnalke <meillo@marmaro.de>
parents:
15
diff
changeset
|
138 fflush(file); |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
139 } |
0 | 140 } |
141 | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
142 #ifdef ENABLE_DEBUG |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
143 void |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
144 vdebugwrite(int pri, const char *fmt, va_list args) |
0 | 145 { |
146 time_t now = time(NULL); | |
147 struct tm *t = localtime(&now); | |
148 gchar buf[24]; | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
149 strftime(buf, 24, "%Y-%m-%d %H:%M:%S", t); |
0 | 150 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
151 if (debugfile) { |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
152 fprintf(debugfile, "%s [%d] ", buf, getpid()); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
153 vfprintf(debugfile, fmt, args); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
154 fflush(debugfile); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
155 } else { |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
156 fprintf(stderr, "no debug file, msg was:\n"); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
157 vfprintf(stderr, fmt, args); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
158 } |
0 | 159 } |
160 #endif | |
161 | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
162 void |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
163 logwrite(int pri, const char *fmt, ...) |
0 | 164 { |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
165 va_list args, args_copy; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
166 int saved_errno = errno; /* somewhere this is changed to EBADF */ |
0 | 167 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
168 va_start(args, fmt); |
0 | 169 #ifdef ENABLE_DEBUG |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
170 va_copy(args_copy, args); |
0 | 171 #endif |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
172 vlogwrite(pri, fmt, args); |
0 | 173 #ifdef ENABLE_DEBUG |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
174 if (debugfile) |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
175 vdebugwrite(pri, fmt, args_copy); |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
176 va_end(args_copy); |
0 | 177 #endif |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
178 va_end(args); |
0 | 179 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
180 errno = saved_errno; |
0 | 181 } |
182 | |
183 #ifdef ENABLE_DEBUG | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
184 void |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
185 debugf(const char *fmt, ...) |
0 | 186 { |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
187 va_list args; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
188 va_start(args, fmt); |
0 | 189 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
190 vdebugwrite(LOG_DEBUG, fmt, args); |
0 | 191 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
192 va_end(args); |
0 | 193 } |
194 | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
195 void |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
196 vdebugf(const char *fmt, va_list args) |
0 | 197 { |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
198 vdebugwrite(LOG_DEBUG, fmt, args); |
0 | 199 } |
200 #endif | |
201 | |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
202 void |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
203 maillog(const char *fmt, ...) |
0 | 204 { |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
205 va_list args; |
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
206 va_start(args, fmt); |
0 | 207 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
208 vlogwrite(LOG_NOTICE, fmt, args); |
0 | 209 |
10
26e34ae9a3e3
changed indention and line wrapping to a more consistent style
meillo@marmaro.de
parents:
0
diff
changeset
|
210 va_end(args); |
0 | 211 } |