All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
log.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15  */
16 #ifndef _FR_LOG_H
17 #define _FR_LOG_H
18 /**
19  * $Id: c9a07594a86c959d99248e1ad74d6b5a68cb8d3a $
20  *
21  * @file include/log.h
22  * @brief Macros and function definitions to write log messages, and control the logging system.
23  *
24  * @copyright 2015 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
25  * @copyright 2013 Alan DeKok <aland@freeradius.org>
26  */
27 RCSIDH(log_h, "$Id: c9a07594a86c959d99248e1ad74d6b5a68cb8d3a $")
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 typedef enum log_type {
34  L_AUTH = 2, //!< Authentication message.
35  L_INFO = 3, //!< Informational message.
36  L_ERR = 4, //!< Error message.
37  L_WARN = 5, //!< Warning.
38  L_PROXY = 6, //!< Proxy messages
39  L_ACCT = 7, //!< Accounting messages
40 
41  L_DBG = 16, //!< Only displayed when debugging is enabled.
42  L_DBG_WARN = 17, //!< Warning only displayed when debugging is enabled.
43  L_DBG_ERR = 18, //!< Error only displayed when debugging is enabled.
44  L_DBG_WARN_REQ = 19, //!< Less severe warning only displayed when debugging is enabled.
45  L_DBG_ERR_REQ = 20 //!< Less severe error only displayed when debugging is enabled.
46 } log_type_t;
47 
48 typedef enum log_lvl {
49  L_DBG_LVL_DISABLE = -1, //!< Don't print messages.
50  L_DBG_LVL_OFF = 0, //!< No debug messages.
51  L_DBG_LVL_1, //!< Highest priority debug messages (-x).
52  L_DBG_LVL_2, //!< 2nd highest priority debug messages (-xx | -X).
53  L_DBG_LVL_3, //!< 3rd highest priority debug messages (-xxx | -Xx).
54  L_DBG_LVL_MAX //!< Lowest priority debug messages (-xxxx | -Xxx).
55 } log_lvl_t;
56 
57 typedef enum log_dst {
58  L_DST_STDOUT = 0, //!< Log to stdout.
59  L_DST_FILES, //!< Log to a file on disk.
60  L_DST_SYSLOG, //!< Log to syslog.
61  L_DST_STDERR, //!< Log to stderr.
62  L_DST_EXTRA, //!< Send log messages to a FILE*, via fopencookie()
63  L_DST_NULL, //!< Discard log messages.
65 } log_dst_t;
66 
67 
68 typedef struct fr_log_t {
69  bool colourise; //!< Prefix log messages with VT100 escape codes to change text
70  //!< colour.
71  int fd; //!< File descriptor to write messages to.
72  log_dst_t dst; //!< Log destination.
73  char const *file; //!< Path to log file.
74 
75  void *cookie; //!< for fopencookie()
76 #ifdef HAVE_FOPENCOOKIE
77  ssize_t (*cookie_write)(void *, char const *, size_t); //!< write function
78 #else
79  int (*cookie_write)(void *, char const *, int); //!< write function
80 #endif
81 } fr_log_t;
82 
83 typedef void (*radlog_func_t)(log_type_t lvl, log_lvl_t priority, REQUEST *, char const *, va_list ap);
84 
87 extern FR_NAME_NUMBER const log_str2dst[];
88 extern fr_log_t default_log;
89 
90 int radlog_init(fr_log_t *log, bool daemonize);
91 
92 int vradlog(log_type_t lvl, char const *fmt, va_list ap)
93  CC_HINT(format (printf, 2, 0)) CC_HINT(nonnull);
94 int radlog(log_type_t lvl, char const *fmt, ...)
95  CC_HINT(format (printf, 2, 3)) CC_HINT(nonnull (2));
96 
97 bool debug_enabled(log_type_t type, log_lvl_t lvl);
98 
99 bool rate_limit_enabled(void);
100 
101 bool radlog_debug_enabled(log_type_t type, log_lvl_t lvl, REQUEST *request)
102  CC_HINT(nonnull);
103 
104 void vradlog_request(log_type_t type, log_lvl_t lvl, REQUEST *request, char const *msg, va_list ap)
105  CC_HINT(format (printf, 4, 0)) CC_HINT(nonnull (3, 4));
106 
107 void radlog_request(log_type_t type, log_lvl_t lvl, REQUEST *request, char const *msg, ...)
108  CC_HINT(format (printf, 4, 5)) CC_HINT(nonnull (3, 4));
109 
110 void radlog_request_error(log_type_t type, log_lvl_t lvl, REQUEST *request, char const *msg, ...)
111  CC_HINT(format (printf, 4, 5)) CC_HINT(nonnull (3, 4));
112 
113 void radlog_request_marker(log_type_t type, log_lvl_t lvl, REQUEST *request,
114  char const *fmt, size_t indent, char const *error)
115  CC_HINT(nonnull);
116 
117 /** @name Log global messages
118  *
119  * Write to the global log.
120  *
121  * Messages will always be written irrespective of the debugging level set with ``-x`` or ``-X``.
122  *
123  * @warning If a REQUEST * is **NOT** available, these macros **MUST** be used.
124  *
125  * @note These macros should only be used for important global events.
126  *
127  * **Debug categories**
128  * Name | Syslog severity | Colour/style | When to use
129  * -------- | ----------------------- | ------------ | -----------
130  * AUTH | LOG_NOTICE | Bold | Never - Deprecated
131  * ACCT | LOG_NOTICE | Bold | Never - Deprecated
132  * PROXY | LOG_NOTICE | Bold | Never - Deprecated
133  * INFO | LOG_INFO | Bold | TBD
134  * WARN | LOG_WARNING | Yellow | Warnings. Impending resource exhaustion, resource exhaustion
135  * ERROR | LOG_ERR | Red | Critical server errors. Malformed queries, failed operations, connection errors, packet processing errors
136  *
137  * @{
138  */
139 #define AUTH(fmt, ...) radlog(L_AUTH, fmt, ## __VA_ARGS__)
140 #define ACCT(fmt, ...) radlog(L_ACCT, fmt, ## __VA_ARGS__)
141 #define PROXY(fmt, ...) radlog(L_PROXY, fmt, ## __VA_ARGS__)
142 
143 #define INFO(fmt, ...) radlog(L_INFO, fmt, ## __VA_ARGS__)
144 #define WARN(fmt, ...) radlog(L_WARN, fmt, ## __VA_ARGS__)
145 #define ERROR(fmt, ...) radlog(L_ERR, fmt, ## __VA_ARGS__)
146 /** @} */
147 
148 /** @name Log global debug messages (DEBUG*)
149  *
150  * Write debugging messages to the global log.
151  *
152  * Messages will be written if the debug level is high enough.
153  *
154  * **Debug categories**
155  * Name | Syslog severity | Colour/style | When to use
156  * -------- | ----------------------- | -------------| -----------
157  * DEBUG | LOG_DEBUG | Regular | Normal debug output
158  *
159  * **Debug levels**
160  * Level | Debug arguments | Macro(s) enabled | When to use
161  * -------- | ----------------------- | ----------------------------- | -----------
162  * 1 | ``-x`` | DEBUG | Never - Deprecated
163  * 2 | ``-xx`` or ``-X`` | DEBUG, DEBUG2 | Interactions with external entities. Connection management, control socket, triggers, etc...
164  * 3 | ``-xxx`` or ``-Xx`` | DEBUG, DEBUG2, DEBUG3 | Lower priority events. Polling for detail files, cleanups, etc...
165  * 4 | ``-xxxx`` or ``-Xxx`` | DEBUG, DEBUG2, DEBUG3, DEBUG4 | Internal server state debugging.
166  *
167  * @{
168  */
169 #define DEBUG_ENABLED debug_enabled(L_DBG, L_DBG_LVL_1) //!< True if global debug level 1 messages are enabled
170 #define DEBUG_ENABLED2 debug_enabled(L_DBG, L_DBG_LVL_2) //!< True if global debug level 1-2 messages are enabled
171 #define DEBUG_ENABLED3 debug_enabled(L_DBG, L_DBG_LVL_3) //!< True if global debug level 1-3 messages are enabled
172 #define DEBUG_ENABLED4 debug_enabled(L_DBG, L_DBG_LVL_MAX) //!< True if global debug level 1-4 messages are enabled
173 
174 #define _SL(_l, _p, _f, ...) if (rad_debug_lvl >= _p) radlog(_l, _f, ## __VA_ARGS__)
175 #define DEBUG(fmt, ...) _SL(L_DBG, L_DBG_LVL_1, fmt, ## __VA_ARGS__)
176 #define DEBUG2(fmt, ...) _SL(L_DBG, L_DBG_LVL_2, fmt, ## __VA_ARGS__)
177 #define DEBUG3(fmt, ...) _SL(L_DBG, L_DBG_LVL_3, fmt, ## __VA_ARGS__)
178 #define DEBUG4(fmt, ...) _SL(L_DBG, L_DBG_LVL_MAX, fmt, ## __VA_ARGS__)
179 /** @} */
180 
181 /** @name Log request-specific messages (R*)
182  *
183  * Write to the request log, or the global log if a request logging function is not set.
184  *
185  * Messages will always be written irrespective of the debugging level set with ``-x`` or ``-X``.
186  *
187  * @note Automatically prepends date (at lvl >= 3), request number, and module, to the log message.
188  * @note If a REQUEST * is available, these macros should be used.
189  * @note These macros should only be used for important global events.
190  *
191  * **Debug categories**
192  * Name | Syslog severity | Colour/style | When to use
193  * -------- | ----------------------- | -------------| -----------
194  * RAUTH | LOG_NOTICE | Bold | Never - Deprecated
195  * RACCT | LOG_NOTICE | Bold | Never - Deprecated
196  * RPROXY | LOG_NOTICE | Bold | Never - Deprecated
197  * RINFO | LOG_INFO | Bold | TBD
198  * RWARN | LOG_WARNING | Yellow/Bold | Warnings. Impending resource exhaustion, or resource exhaustion.
199  * RERROR | LOG_ERR | Red/Bold | Critical server errors. Malformed queries, failed operations, connection errors, packet processing errors.
200  * @{
201  */
202 #define RAUTH(fmt, ...) radlog_request(L_AUTH, L_DBG_LVL_OFF, request, fmt, ## __VA_ARGS__)
203 #define RACCT(fmt, ...) radlog_request(L_ACCT, L_DBG_LVL_OFF, request, fmt, ## __VA_ARGS__)
204 #define RPROXY(fmt, ...) radlog_request(L_PROXY, L_DBG_LVL_OFF, request, fmt, ## __VA_ARGS__)
205 #define RINFO(fmt, ...) radlog_request(L_INFO, L_DBG_LVL_OFF, request, fmt, ## __VA_ARGS__)
206 #define RWARN(fmt, ...) radlog_request(L_DBG_WARN, L_DBG_LVL_OFF, request, fmt, ## __VA_ARGS__)
207 #define RERROR(fmt, ...) radlog_request_error(L_DBG_ERR, L_DBG_LVL_OFF, request, fmt, ## __VA_ARGS__)
208 /** @} */
209 
210 /** @name Log request-specific debug (R*DEBUG*)
211  *
212  * Write debug messages to the request log.
213  *
214  * Messages will only be written if a request log function is set and the request or global
215  * debug level is high enough.
216  *
217  * @note Automatically prepends date (at lvl >= 3), request number, and module, to the log message.
218  *
219  * **Debug categories**
220  * Name | Syslog severity | Colour and style | When to use
221  * -------- | ----------------------- | -----------------| -----------
222  * RDEBUG* | LOG_DEBUG | Regular | Normal debugging messages
223  * RIDEBUG* | LOG_DEBUG | Bold | Informational messages.
224  * RWDEBUG* | LOG_DEBUG | Yellow/Bold | Warnings. Invalid configuration, missing or invalid attributes etc...
225  * REDEBUG* | LOG_DEBUG | Red/Bold | Errors. Reject messages, bad values etc...
226  *
227  * **Debug levels**
228  * Level | Debug arguments | Macro(s) enabled | When to use
229  * -------- | ----------------------- | -------------------------------------- | -----------
230  * 1 | ``-x`` | R*DEBUG | Never - Deprecated
231  * 2 | ``-xx`` or ``-X`` | R*DEBUG, R*DEBUG2 | Normal request flow. Operations, Results of queries, or execs, etc...
232  * 3 | ``-xxx`` or ``-Xx`` | R*DEBUG, R*DEBUG2, R*DEBUG3 | Internal server state or packet input. State machine changes, extra attribute info, etc...
233  * 4 | ``-xxxx`` or ``-Xxx`` | R*DEBUG, R*DEBUG2, R*DEBUG3, R*DEBUG4 | Verbose internal server state messages or packet input. Hex dumps, structure dumps, pointer values.
234  *
235  * @{
236  */
237 #define RDEBUG_ENABLED radlog_debug_enabled(L_DBG, L_DBG_LVL_1, request) //!< True if request debug level 1 messages are enabled
238 #define RDEBUG_ENABLED2 radlog_debug_enabled(L_DBG, L_DBG_LVL_2, request) //!< True if request debug level 1-2 messages are enabled
239 #define RDEBUG_ENABLED3 radlog_debug_enabled(L_DBG, L_DBG_LVL_3, request) //!< True if request debug level 1-3 messages are enabled
240 #define RDEBUG_ENABLED4 radlog_debug_enabled(L_DBG, L_DBG_LVL_MAX, request) //!< True if request debug level 1-4 messages are enabled
241 
242 #define RDEBUGX(_l, fmt, ...) radlog_request(L_DBG, _l, request, fmt, ## __VA_ARGS__)
243 #define RDEBUG(fmt, ...) if (rad_debug_lvl || request->log.lvl) radlog_request(L_DBG, L_DBG_LVL_1, request, fmt, ## __VA_ARGS__)
244 #define RDEBUG2(fmt, ...) if (rad_debug_lvl || request->log.lvl) radlog_request(L_DBG, L_DBG_LVL_2, request, fmt, ## __VA_ARGS__)
245 #define RDEBUG3(fmt, ...) if (rad_debug_lvl || request->log.lvl) radlog_request(L_DBG, L_DBG_LVL_3, request, fmt, ## __VA_ARGS__)
246 #define RDEBUG4(fmt, ...) if (rad_debug_lvl || request->log.lvl) radlog_request(L_DBG, L_DBG_LVL_MAX, request, fmt, ## __VA_ARGS__)
247 
248 #define RIDEBUG(fmt, ...) radlog_request(L_INFO, L_DBG_LVL_1, request, fmt, ## __VA_ARGS__)
249 #define RIDEBUG2(fmt, ...) radlog_request(L_INFO, L_DBG_LVL_2, request, fmt, ## __VA_ARGS__)
250 
251 #define RWDEBUG(fmt, ...) if (rad_debug_lvl || request->log.lvl) radlog_request(L_DBG_WARN, L_DBG_LVL_1, request, fmt, ## __VA_ARGS__)
252 #define RWDEBUG2(fmt, ...) if (rad_debug_lvl || request->log.lvl) radlog_request(L_DBG_WARN, L_DBG_LVL_2, request, fmt, ## __VA_ARGS__)
253 
254 #define REDEBUG(fmt, ...) radlog_request_error(L_DBG_ERR, L_DBG_LVL_1, request, fmt, ## __VA_ARGS__)
255 #define REDEBUG2(fmt, ...) radlog_request_error(L_DBG_ERR, L_DBG_LVL_2, request, fmt, ## __VA_ARGS__)
256 #define REDEBUG3(fmt, ...) radlog_request_error(L_DBG_ERR, L_DBG_LVL_3, request, fmt, ## __VA_ARGS__)
257 #define REDEBUG4(fmt, ...) radlog_request_error(L_DBG_ERR, L_DBG_LVL_MAX, request, fmt, ## __VA_ARGS__)
258 /** @} */
259 
260 /** Indent R* messages by one level
261  *
262  * @note Has no effect on the indentation of INFO, WARN, ERROR, DEBUG messages,
263  * only RINFO, RWARN, RERROR etc...
264  */
265 #define RINDENT() (request->log.indent += 2)
266 
267 /** Exdent (unindent) R* messages by one level
268  *
269  * @note Has no effect on the indentation of INFO, WARN, ERROR, DEBUG messages,
270  * only RINFO, RWARN, RERROR etc...
271  */
272 #define REXDENT() (request->log.indent -= 2)
273 
274 /** Output string with error marker, showing where format error occurred
275  *
276  @verbatim
277  my pet kitty
278  ^ kitties are not pets, are nature devouring hell beasts
279  @endverbatim
280  *
281  * @warning If a REQUEST * is **NOT** available, or is NULL, this macro must **NOT** be used.
282  *
283  * @param _l log category, a log_type_t value.
284  * @param _p log priority, a log_lvl_t value.
285  * @param _m string to mark e.g. "my pet kitty".
286  * @param _i index e.g. 3 (starts from 0).
287  * @param _e error e.g. "kitties are not pets, are nature devouring hell beasts".
288  */
289 #define RMARKER(_l, _p, _m, _i, _e) radlog_request_marker(_l, _p, request, _m, _i, _e)
290 
291 /** Output string with error marker, showing where format error occurred
292  *
293  * These are logged as RERROR messages.
294  *
295  @verbatim
296  my pet kitty
297  ^ kitties are not pets, are nature devouring hell beasts
298  @endverbatim
299  *
300  * @warning If a REQUEST * is **NOT** available, or is NULL, this macro must **NOT** be used.
301  *
302  * @param _m string to mark e.g. "my pet kitty".
303  * @param _i index e.g. 3 (starts from 0).
304  * @param _e error e.g. "kitties are not pets, are nature devouring hell beasts".
305  */
306 #define REMARKER(_m, _i, _e) RMARKER(L_DBG_ERR, L_DBG_LVL_1, _m, _i, _e)
307 
308 /** Output string with error marker, showing where format error occurred
309  *
310  * These are logged as RDEBUG messages.
311  *
312  @verbatim
313  my pet kitty
314  ^ kitties are not pets, are nature devouring hell beasts
315  @endverbatim
316  *
317  * @warning If a REQUEST * is **NOT** available, or is NULL, this macro must **NOT** be used.
318  *
319  * @param _m string to mark e.g. "my pet kitty".
320  * @param _i index e.g. 3 (starts from 0).
321  * @param _e error e.g. "kitties are not pets, are nature devouring hell beasts".
322  */
323 #define RDMARKER(_m, _i, _e) RMARKER(L_DBG, L_DBG_LVL_1, _m, _i, _e)
324 
325 /** Use different logging functions depending on whether request is NULL or not.
326  *
327  * @note The module must define MOD_PREFIX as its name (do this in the module
328  * header file) e.g. @code{.c}#define MOD_PREFIX "rlm_example"@endcode
329  *
330  * This is useful for areas of code which are run on server startup, and when
331  * processing requests.
332  *
333  * @param _l_request The name of a R* logging macro e.g. RDEBUG3.
334  * @param _l_global The name of a global logging macro e.g. DEBUG3.
335  * @param fmt printf style format string.
336  * @param ... printf arguments.
337  */
338  #define MOD_ROPTIONAL(_l_request, _l_global, fmt, ...) \
339 do {\
340  if (request) {\
341  _l_request(fmt, ## __VA_ARGS__);\
342  } else {\
343  _l_global(MOD_PREFIX " (%s): " fmt, inst->name, ## __VA_ARGS__);\
344  }\
345 } while (0)
346 
347 /** Use different logging functions depending on whether request is NULL or not.
348  *
349  * This is useful for areas of code which are run on server startup, and when
350  * processing requests.
351  *
352  * @param _l_request The name of a R* logging macro e.g. RDEBUG3.
353  * @param _l_global The name of a global logging macro e.g. DEBUG3.
354  * @param fmt printf style format string.
355  * @param ... printf arguments.
356  */
357  #define ROPTIONAL(_l_request, _l_global, fmt, ...) \
358 do {\
359  if (request) {\
360  _l_request(fmt, ## __VA_ARGS__);\
361  } else {\
362  _l_global(LOG_PREFIX ": " fmt, ## __VA_ARGS__);\
363  }\
364 } while (0)
365 
366 #define RATE_LIMIT_ENABLED rate_limit_enabled() //!< True if rate limiting is enabled.
367 /** Rate limit messages
368  *
369  * Rate limit log messages so they're written a maximum of once per second.
370  *
371  @code{.c}
372  RATE_LIMIT(RERROR("Home servers alive in pool %s", pool->name));
373  @endcode
374  * @note Rate limits the macro, not the message. If five different messages are
375  * produced using the same macro in the same second, only the first will
376  * be written to the log.
377  *
378  * @param _x Logging macro to limit.
379  */
380 #define RATE_LIMIT(_x) \
381 do {\
382  if (RATE_LIMIT_ENABLED) {\
383  static time_t _last_complained = 0;\
384  time_t _now = time(NULL);\
385  if (_now != _last_complained) {\
386  _last_complained = _now;\
387  _x;\
388  }\
389  } else _x;\
390 } while (0)
391 
392 #ifdef __cplusplus
393 }
394 #endif
395 
396 #endif /* _FR_LOG_H */
#define RCSIDH(h, id)
Definition: build.h:136
log_type
Definition: log.h:33
2nd highest priority debug messages (-xx | -X).
Definition: log.h:52
int CC_HINT(nonnull)
Definition: rlm_always.c:112
Only displayed when debugging is enabled.
Definition: log.h:41
Send log messages to a FILE*, via fopencookie()
Definition: log.h:62
void(* radlog_func_t)(log_type_t lvl, log_lvl_t priority, REQUEST *, char const *, va_list ap)
Definition: log.h:83
enum log_type log_type_t
Less severe warning only displayed when debugging is enabled.
Definition: log.h:44
void * cookie
for fopencookie()
Definition: log.h:75
int radlog(log_type_t lvl, char const *fmt,...) CC_HINT(format(printf
3rd highest priority debug messages (-xxx | -Xx).
Definition: log.h:53
Warning.
Definition: log.h:37
int(* cookie_write)(void *, char const *, int)
write function
Definition: log.h:79
Less severe error only displayed when debugging is enabled.
Definition: log.h:45
Log to syslog.
Definition: log.h:60
Error message.
Definition: log.h:36
bool debug_enabled(log_type_t type, log_lvl_t lvl)
Whether a server debug message should be logged.
Definition: log.c:579
log_dst
Definition: log.h:57
FR_NAME_NUMBER const log_str2dst[]
Definition: log.c:205
fr_log_t default_log
Definition: log.c:216
void vradlog_request(log_type_t type, log_lvl_t lvl, REQUEST *request, char const *msg, va_list ap) CC_HINT(format(printf
void radlog_request_error(log_type_t type, log_lvl_t lvl, REQUEST *request, char const *msg,...) CC_HINT(format(printf
Highest priority debug messages (-x).
Definition: log.h:51
Accounting messages.
Definition: log.h:39
No debug messages.
Definition: log.h:50
Log to stderr.
Definition: log.h:61
Lowest priority debug messages (-xxxx | -Xxx).
Definition: log.h:54
FR_NAME_NUMBER const syslog_severity_table[]
Syslog severity table.
Definition: log.c:177
bool radlog_debug_enabled(log_type_t type, log_lvl_t lvl, REQUEST *request) CC_HINT(nonnull)
Whether a request specific debug message should be logged.
Definition: log.c:604
Definition: log.h:68
Authentication message.
Definition: log.h:34
log_lvl
Definition: log.h:48
int radlog_init(fr_log_t *log, bool daemonize)
Initialise file descriptors based on logging destination.
Definition: log.c:257
void radlog_request(log_type_t type, log_lvl_t lvl, REQUEST *request, char const *msg,...) CC_HINT(format(printf
char const * file
Path to log file.
Definition: log.h:73
Log to a file on disk.
Definition: log.h:59
enum log_dst log_dst_t
enum log_lvl log_lvl_t
bool rate_limit_enabled(void)
Whether rate limiting is enabled.
Definition: log.c:588
Proxy messages.
Definition: log.h:38
Don't print messages.
Definition: log.h:49
Discard log messages.
Definition: log.h:63
FR_NAME_NUMBER const syslog_facility_table[]
Syslog facility table.
Definition: log.c:110
Error only displayed when debugging is enabled.
Definition: log.h:43
struct fr_log_t fr_log_t
bool colourise
Prefix log messages with VT100 escape codes to change text colour.
Definition: log.h:69
Warning only displayed when debugging is enabled.
Definition: log.h:42
log_dst_t dst
Log destination.
Definition: log.h:72
Log to stdout.
Definition: log.h:58
Informational message.
Definition: log.h:35
void radlog_request_marker(log_type_t type, log_lvl_t lvl, REQUEST *request, char const *fmt, size_t indent, char const *error) CC_HINT(nonnull)
Write the string being parsed, and a marker showing where the parse error occurred.
Definition: log.c:873
int fd
File descriptor to write messages to.
Definition: log.h:71
int vradlog(log_type_t lvl, char const *fmt, va_list ap) CC_HINT(format(printf