suricata
util-debug.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2010 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
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  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Anoop Saldanha <anoopsaldanha@gmail.com>
22  */
23 
24 #ifndef __UTIL_DEBUG_H__
25 #define __UTIL_DEBUG_H__
26 
27 #include <stdio.h>
28 #include <stdint.h>
29 #include <pcre.h>
30 
31 #include "threads.h"
32 #include "util-enum.h"
33 #include "util-error.h"
34 #include "util-debug-filters.h"
35 
36 /**
37  * \brief ENV vars that can be used to set the properties for the logging module
38  */
39 #define SC_LOG_ENV_LOG_LEVEL "SC_LOG_LEVEL"
40 #define SC_LOG_ENV_LOG_OP_IFACE "SC_LOG_OP_IFACE"
41 #define SC_LOG_ENV_LOG_FILE "SC_LOG_FILE"
42 #define SC_LOG_ENV_LOG_FACILITY "SC_LOG_FACILITY"
43 #define SC_LOG_ENV_LOG_FORMAT "SC_LOG_FORMAT"
44 #define SC_LOG_ENV_LOG_OP_FILTER "SC_LOG_OP_FILTER"
45 
46 /**
47  * \brief The various log levels
48  * NOTE: when adding new level, don't forget to update SCLogMapLogLevelToSyslogLevel()
49  * or it may result in logging to syslog with LOG_EMERG priority.
50  */
51 typedef enum {
65 } SCLogLevel;
66 
67 /**
68  * \brief The various output interfaces supported
69  */
70 typedef enum {
75 } SCLogOPIface;
76 
77 typedef enum {
80 } SCLogOPType;
81 
82 /* The default log_format, if it is not supplied by the user */
83 #ifdef RELEASE
84 #define SC_LOG_DEF_LOG_FORMAT "%t - <%d> - "
85 #else
86 #define SC_LOG_DEF_LOG_FORMAT "[%i] %t - (%f:%l) <%d> (%n) -- "
87 #endif
88 
89 /* The maximum length of the log message */
90 #define SC_LOG_MAX_LOG_MSG_LEN 2048
91 
92 /* The maximum length of the log format */
93 #define SC_LOG_MAX_LOG_FORMAT_LEN 128
94 
95 /* The default log level, if it is not supplied by the user */
96 #define SC_LOG_DEF_LOG_LEVEL SC_LOG_INFO
97 
98 /* The default output interface to be used */
99 #define SC_LOG_DEF_LOG_OP_IFACE SC_LOG_OP_IFACE_CONSOLE
100 
101 /* The default log file to be used */
102 #define SC_LOG_DEF_LOG_FILE "suricata.log"
103 
104 /* The default syslog facility to be used */
105 #define SC_LOG_DEF_SYSLOG_FACILITY_STR "local0"
106 #define SC_LOG_DEF_SYSLOG_FACILITY LOG_LOCAL0
107 
108 /**
109  * \brief Structure to be used when log_level override support would be provided
110  * by the logging module
111  */
112 typedef struct SCLogOPBuffer_ {
114  char *temp;
115  const char *log_format;
116 } SCLogOPBuffer;
117 
118 /**
119  * \brief The output interface context for the logging module
120  */
121 typedef struct SCLogOPIfaceCtx_ {
123 
124  int16_t use_color;
125  int16_t type;
126 
127  /* the output file to be used if the interface is SC_LOG_IFACE_FILE */
128  const char *file;
129  /* the output file descriptor for the above file */
130  FILE * file_d;
131 
132  /* registered to be set on a file rotation signal */
134 
135  /* the facility code if the interface is SC_LOG_IFACE_SYSLOG */
136  int facility;
137 
138  /* override for the global_log_level */
140 
141  /* override for the global_log_format(currently not used) */
142  const char *log_format;
143 
144  /* Mutex used for locking around rotate/write to a file. */
146 
149 
150 /**
151  * \brief Structure containing init data, that would be passed to
152  * SCInitDebugModule()
153  */
154 typedef struct SCLogInitData_ {
155  /* startup message */
156  const char *startup_message;
157 
158  /* the log level */
160 
161  /* the log format */
162  const char *global_log_format;
163 
164  /* output filter */
165  const char *op_filter;
166 
167  /* list of output interfaces to be used */
169  /* no of op ifaces */
170  uint8_t op_ifaces_cnt;
171 } SCLogInitData;
172 
173 /**
174  * \brief Holds the config state used by the logging api
175  */
176 typedef struct SCLogConfig_ {
179  char *log_format;
180 
181  char *op_filter;
182  /* compiled pcre filter expression */
185 
186  /* op ifaces used */
188  /* no of op ifaces */
189  uint8_t op_ifaces_cnt;
190 } SCLogConfig;
191 
192 /* The different log format specifiers supported by the API */
193 #define SC_LOG_FMT_TIME 't' /* Timestamp in standard format */
194 #define SC_LOG_FMT_PID 'p' /* PID */
195 #define SC_LOG_FMT_TID 'i' /* Thread ID */
196 #define SC_LOG_FMT_TM 'm' /* Thread module name */
197 #define SC_LOG_FMT_LOG_LEVEL 'd' /* Log level */
198 #define SC_LOG_FMT_FILE_NAME 'f' /* File name */
199 #define SC_LOG_FMT_LINE 'l' /* Line number */
200 #define SC_LOG_FMT_FUNCTION 'n' /* Function */
201 
202 /* The log format prefix for the format specifiers */
203 #define SC_LOG_FMT_PREFIX '%'
204 
206 
207 extern int sc_log_module_initialized;
208 
209 extern int sc_log_module_cleaned;
210 
211 #define SCLog(x, file, func, line, ...) \
212  do { \
213  if (sc_log_global_log_level >= x && \
214  (sc_log_fg_filters_present == 0 || \
215  SCLogMatchFGFilterWL(file, func, line) == 1 || \
216  SCLogMatchFGFilterBL(file, func, line) == 1) && \
217  (sc_log_fd_filters_present == 0 || \
218  SCLogMatchFDFilter(func) == 1)) \
219  { \
220  char _sc_log_msg[SC_LOG_MAX_LOG_MSG_LEN]; \
221  \
222  int _sc_log_ret = snprintf(_sc_log_msg, SC_LOG_MAX_LOG_MSG_LEN, __VA_ARGS__); \
223  if (_sc_log_ret == SC_LOG_MAX_LOG_MSG_LEN) \
224  _sc_log_msg[SC_LOG_MAX_LOG_MSG_LEN - 1] = '\0'; \
225  \
226  SCLogMessage(x, file, line, func, SC_OK, _sc_log_msg); \
227  } \
228  } while(0)
229 
230 #define SCLogErr(x, file, func, line, err, ...) \
231  do { \
232  if (sc_log_global_log_level >= x && \
233  (sc_log_fg_filters_present == 0 || \
234  SCLogMatchFGFilterWL(file, func, line) == 1 || \
235  SCLogMatchFGFilterBL(file, func, line) == 1) && \
236  (sc_log_fd_filters_present == 0 || \
237  SCLogMatchFDFilter(func) == 1)) \
238  { \
239  char _sc_log_msg[SC_LOG_MAX_LOG_MSG_LEN]; \
240  \
241  int _sc_log_ret = snprintf(_sc_log_msg, SC_LOG_MAX_LOG_MSG_LEN, __VA_ARGS__); \
242  if (_sc_log_ret == SC_LOG_MAX_LOG_MSG_LEN) \
243  _sc_log_msg[SC_LOG_MAX_LOG_MSG_LEN - 1] = '\0'; \
244  \
245  SCLogMessage(x, file, line, func, err, _sc_log_msg); \
246  } \
247  } while(0)
248 
249 /**
250  * \brief Macro used to log INFORMATIONAL messages.
251  *
252  * \retval ... Takes as argument(s), a printf style format message
253  */
254 #define SCLogInfo(...) SCLog(SC_LOG_INFO, \
255  __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
256 #define SCLogInfoRaw(file, func, line, ...) SCLog(SC_LOG_INFO, \
257  (file), (func), (line), __VA_ARGS__)
258 
259 #define SCLogConfig(...) SCLog(SC_LOG_CONFIG, \
260  __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
261 #define SCLogPerf(...) SCLog(SC_LOG_PERF, \
262  __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
263 
264 /**
265  * \brief Macro used to log NOTICE messages.
266  *
267  * \retval ... Takes as argument(s), a printf style format message
268  */
269 #define SCLogNotice(...) SCLog(SC_LOG_NOTICE, \
270  __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
271 #define SCLogNoticeRaw(file, func, line, ... ) SCLog(SC_LOG_NOTICE, \
272  (file), (func), (line), __VA_ARGS__)
273 
274 /**
275  * \brief Macro used to log WARNING messages.
276  *
277  * \retval err_code Error code that has to be logged along with the
278  * warning message
279  * \retval ... Takes as argument(s), a printf style format message
280  */
281 #define SCLogWarning(err_code, ...) SCLogErr(SC_LOG_WARNING, \
282  __FILE__, __FUNCTION__, __LINE__, \
283  err_code, __VA_ARGS__)
284 #define SCLogWarningRaw(err_code, file, func, line, ...) \
285  SCLogErr(SC_LOG_WARNING, (file), (func), (line), err_code, __VA_ARGS__)
286 
287 /**
288  * \brief Macro used to log ERROR messages.
289  *
290  * \retval err_code Error code that has to be logged along with the
291  * error message
292  * \retval ... Takes as argument(s), a printf style format message
293  */
294 #define SCLogError(err_code, ...) SCLogErr(SC_LOG_ERROR, \
295  __FILE__, __FUNCTION__, __LINE__, \
296  err_code, __VA_ARGS__)
297 #define SCLogErrorRaw(err_code, file, func, line, ...) SCLogErr(SC_LOG_ERROR, \
298  (file), (func), (line), err_code, __VA_ARGS__)
299 
300 /**
301  * \brief Macro used to log CRITICAL messages.
302  *
303  * \retval err_code Error code that has to be logged along with the
304  * critical message
305  * \retval ... Takes as argument(s), a printf style format message
306  */
307 #define SCLogCritical(err_code, ...) SCLogErr(SC_LOG_CRITICAL, \
308  __FILE__, __FUNCTION__, __LINE__, \
309  err_code, __VA_ARGS__)
310 /**
311  * \brief Macro used to log ALERT messages.
312  *
313  * \retval err_code Error code that has to be logged along with the
314  * alert message
315  * \retval ... Takes as argument(s), a printf style format message
316  */
317 #define SCLogAlert(err_code, ...) SCLogErr(SC_LOG_ALERT, \
318  __FILE__, __FUNCTION__, __LINE__, \
319  err_code, __VA_ARGS__)
320 /**
321  * \brief Macro used to log EMERGENCY messages.
322  *
323  * \retval err_code Error code that has to be logged along with the
324  * emergency message
325  * \retval ... Takes as argument(s), a printf style format message
326  */
327 #define SCLogEmerg(err_code, ...) SCLogErr(SC_LOG_EMERGENCY, \
328  __FILE__, __FUNCTION__, __LINE__, \
329  err_code, __VA_ARGS__)
330 
331 
332 /* Avoid the overhead of using the debugging subsystem, in production mode */
333 #ifndef DEBUG
334 
335 #define SCLogDebug(...) do { } while (0)
336 
337 #define SCEnter(...)
338 
339 #define SCReturn return
340 
341 #define SCReturnInt(x) return x
342 
343 #define SCReturnUInt(x) return x
344 
345 #define SCReturnDbl(x) return x
346 
347 #define SCReturnChar(x) return x
348 
349 #define SCReturnCharPtr(x) return x
350 
351 #define SCReturnCT(x, type) return x
352 
353 #define SCReturnPtr(x, type) return x
354 
355 /* Please use it only for debugging purposes */
356 #else
357 
358 
359 /**
360  * \brief Macro used to log DEBUG messages. Comes under the debugging subsystem,
361  * and hence will be enabled only in the presence of the DEBUG macro.
362  *
363  * \retval ... Takes as argument(s), a printf style format message
364  */
365 #define SCLogDebug(...) SCLog(SC_LOG_DEBUG, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
366 
367 /**
368  * \brief Macro used to log debug messages on function entry. Comes under the
369  * debugging subsystem, and hence will be enabled only in the presence
370  * of the DEBUG macro. Apart from logging function_entry logs, it also
371  * processes the FD filters, if any FD filters are registered.
372  *
373  * \retval f An argument can be supplied, although it is not used
374  */
375 #define SCEnter(f) do { \
376  if (sc_log_global_log_level >= SC_LOG_DEBUG &&\
377  SCLogCheckFDFilterEntry(__FUNCTION__)) \
378  { \
379  SCLogDebug("Entering ... >>"); \
380  } \
381  } while(0)
382 
383 
384 /**
385  * \brief Macro used to log debug messages on function exit. Comes under the
386  * debugging sybsystem, and hence will be enabled only in the presence
387  * of the DEBUG macro. Apart from logging function_exit logs, it also
388  * processes the FD filters, if any FD filters are registered. This
389  * function_exit macro should be used for functions that don't return
390  * a value.
391  */
392 #define SCReturn do { \
393  if (sc_log_global_log_level >= SC_LOG_DEBUG) { \
394  SCLogDebug("Returning ... <<" ); \
395  SCLogCheckFDFilterExit(__FUNCTION__); \
396  } \
397  return; \
398  } while(0)
399 
400 /**
401  * \brief Macro used to log debug messages on function exit. Comes under the
402  * debugging sybsystem, and hence will be enabled only in the presence
403  * of the DEBUG macro. Apart from logging function_exit logs, it also
404  * processes the FD filters, if any FD filters are registered. This
405  * function_exit macro should be used for functions that returns an
406  * integer value.
407  *
408  * \retval x Variable of type 'integer' that has to be returned
409  */
410 #define SCReturnInt(x) do { \
411  if (sc_log_global_log_level >= SC_LOG_DEBUG) { \
412  SCLogDebug("Returning: %"PRIdMAX" ... <<", (intmax_t)x); \
413  SCLogCheckFDFilterExit(__FUNCTION__); \
414  } \
415  return x; \
416  } while(0)
417 
418 /**
419  * \brief Macro used to log debug messages on function exit. Comes under the
420  * debugging sybsystem, and hence will be enabled only in the presence
421  * of the DEBUG macro. Apart from logging function_exit logs, it also
422  * processes the FD filters, if any FD filters are registered. This
423  * function_exit macro should be used for functions that returns an
424  * unsigned integer value.
425  *
426  * \retval x Variable of type 'unsigned integer' that has to be returned
427  */
428 #define SCReturnUInt(x) do { \
429  if (sc_log_global_log_level >= SC_LOG_DEBUG) { \
430  SCLogDebug("Returning: %"PRIuMAX" ... <<", (uintmax_t)x); \
431  SCLogCheckFDFilterExit(__FUNCTION__); \
432  } \
433  return x; \
434  } while(0)
435 
436 /**
437  * \brief Macro used to log debug messages on function exit. Comes under the
438  * debugging sybsystem, and hence will be enabled only in the presence
439  * of the DEBUG macro. Apart from logging function_exit logs, it also
440  * processes the FD filters, if any FD filters are registered. This
441  * function_exit macro should be used for functions that returns a
442  * float/double value.
443  *
444  * \retval x Variable of type 'float/double' that has to be returned
445  */
446 #define SCReturnDbl(x) do { \
447  if (sc_log_global_log_level >= SC_LOG_DEBUG) { \
448  SCLogDebug("Returning: %f ... <<", x); \
449  SCLogCheckFDFilterExit(__FUNCTION__); \
450  } \
451  return x; \
452  } while(0)
453 
454 /**
455  * \brief Macro used to log debug messages on function exit. Comes under the
456  * debugging sybsystem, and hence will be enabled only in the presence
457  * of the DEBUG macro. Apart from logging function_exit logs, it also
458  * processes the FD filters, if any FD filters are registered. This
459  * function_exit macro should be used for functions that returns a var
460  * of character type.
461  *
462  * \retval x Variable of type 'char' that has to be returned
463  */
464 #define SCReturnChar(x) do { \
465  if (sc_log_global_log_level >= SC_LOG_DEBUG) { \
466  SCLogDebug("Returning: %c ... <<", x); \
467  SCLogCheckFDFilterExit(__FUNCTION__); \
468  } \
469  return x; \
470  } while(0)
471 
472 /**
473  * \brief Macro used to log debug messages on function exit. Comes under the
474  * debugging sybsystem, and hence will be enabled only in the presence
475  * of the DEBUG macro. Apart from logging function_exit logs, it also
476  * processes the FD filters, if any FD filters are registered. This
477  * function_exit macro should be used for functions that returns a
478  * character string.
479  *
480  * \retval x Pointer to the char string that has to be returned
481  */
482 #define SCReturnCharPtr(x) do { \
483  if (sc_log_global_log_level >= SC_LOG_DEBUG) { \
484  if ((x) != NULL) { \
485  SCLogDebug("Returning: %s ... <<", x); \
486  } else { \
487  SCLogDebug("Returning: NULL ... <<"); \
488  } SCLogCheckFDFilterExit(__FUNCTION__); \
489  } \
490  return x; \
491  } while(0)
492 
493 
494 /**
495  * \brief Macro used to log debug messages on function exit. Comes under the
496  * debugging sybsystem, and hence will be enabled only in the presence
497  * of the DEBUG macro. Apart from logging function_exit logs, it also
498  * processes the FD filters, if any FD filters are registered. This
499  * function_exit macro should be used for functions that returns a var
500  * of custom type
501  *
502  * \retval x Variable instance of a custom type that has to be returned
503  * \retval type Pointer to a character string holding the name of the custom
504  * type(the argument x) that has to be returned
505  */
506 #define SCReturnCT(x, type) do { \
507  if (sc_log_global_log_level >= SC_LOG_DEBUG) { \
508  SCLogDebug("Returning var of " \
509  "type %s ... <<", type); \
510  SCLogCheckFDFilterExit(__FUNCTION__); \
511  } \
512  return x; \
513  } while(0)
514 
515 /**
516  * \brief Macro used to log debug messages on function exit. Comes under the
517  * debugging sybsystem, and hence will be enabled only in the presence
518  * of the DEBUG macro. Apart from logging function_exit logs, it also
519  * processes the FD filters, if any FD filters are registered. This
520  * function_exit macro should be used for functions that returns a
521  * pointer to a custom type
522  *
523  * \retval x Pointer to a variable instance of a custom type that has to be
524  * returned
525  * \retval type Pointer to a character string holding the name of the custom
526  * type(the argument x) that has to be returned
527  */
528 #define SCReturnPtr(x, type) do { \
529  if (sc_log_global_log_level >= SC_LOG_DEBUG) { \
530  SCLogDebug("Returning pointer %p of " \
531  "type %s ... <<", x, type); \
532  SCLogCheckFDFilterExit(__FUNCTION__); \
533  } \
534  return x; \
535  } while(0)
536 
537 #endif /* DEBUG */
538 
539 #define FatalError(x, ...) do { \
540  SCLogError(x, __VA_ARGS__); \
541  exit(EXIT_FAILURE); \
542 } while(0)
543 
544 /** \brief Fatal error IF we're starting up, and configured to consider
545  * errors to be fatal errors */
546 #if !defined(__clang_analyzer__)
547 #define FatalErrorOnInit(x, ...) do { \
548  int init_errors_fatal = 0; \
549  ConfGetBool("engine.init-failure-fatal", &init_errors_fatal); \
550  if (init_errors_fatal && (SC_ATOMIC_GET(engine_stage) == SURICATA_INIT))\
551  { \
552  SCLogError(x, __VA_ARGS__); \
553  exit(EXIT_FAILURE); \
554  } \
555  SCLogWarning(x, __VA_ARGS__); \
556 } while(0)
557 /* make it simpler for scan-build */
558 #else
559 #define FatalErrorOnInit(x, ...) FatalError(x, __VA_ARGS__)
560 #endif
561 
563 
564 SCLogOPIfaceCtx *SCLogInitOPIfaceCtx(const char *, const char *, int,
565  const char *);
566 
568 
570 
571 void SCLogDeInitLogModule(void);
572 
573 SCError SCLogMessage(const SCLogLevel, const char *, const unsigned int,
574  const char *, const SCError, const char *message);
575 
577 
578 int SCLogDebugEnabled(void);
579 
580 void SCLogRegisterTests(void);
581 
582 void SCLogLoadConfig(int daemon, int verbose);
583 
584 #endif /* __UTIL_DEBUG_H__ */
#define SCMutex
uint8_t op_ifaces_cnt
Definition: util-debug.h:189
SCLogOPIfaceCtx * SCLogInitOPIfaceCtx(const char *, const char *, int, const char *)
Creates a new output interface based on the arguments sent. The kind of output interface to be create...
Definition: util-debug.c:1212
SCLogLevel log_level
Definition: util-debug.h:178
void SCLogLoadConfig(int daemon, int verbose)
Definition: util-debug.c:1286
const char * log_format
Definition: util-debug.h:142
SCLogLevel global_log_level
Definition: util-debug.h:159
SCLogOPIface
The various output interfaces supported.
Definition: util-debug.h:70
int sc_log_module_initialized
Used to indicate whether the logging module has been init or not.
Definition: util-debug.c:100
Holds the config state used by the logging api.
Definition: util-debug.h:176
char * log_format
Definition: util-debug.h:179
#define SC_LOG_MAX_LOG_MSG_LEN
Definition: util-debug.h:90
struct SCLogOPBuffer_ SCLogOPBuffer
Structure to be used when log_level override support would be provided by the logging module...
const char * startup_message
Definition: util-debug.h:156
const char * op_filter
Definition: util-debug.h:165
SCLogOPIface iface
Definition: util-debug.h:122
SCLogInitData * SCLogAllocLogInitData(void)
Returns a pointer to a new SCLogInitData. This is a public interface intended to be used after the lo...
Definition: util-debug.c:1104
int16_t use_color
Definition: util-debug.h:124
Structure to be used when log_level override support would be provided by the logging module...
Definition: util-debug.h:112
SCLogOPIfaceCtx * op_ifaces
Definition: util-debug.h:168
SCLogLevel
The various log levels NOTE: when adding new level, don&#39;t forget to update SCLogMapLogLevelToSyslogLe...
Definition: util-debug.h:51
char * startup_message
Definition: util-debug.h:177
uint8_t op_ifaces_cnt
Definition: util-debug.h:170
const char * file
Definition: util-debug.h:128
Structure containing init data, that would be passed to SCInitDebugModule()
Definition: util-debug.h:154
SCLogLevel log_level
Definition: util-debug.h:139
SCLogOPType
Definition: util-debug.h:77
void SCLogRegisterTests(void)
Definition: util-debug.c:1671
SCLogLevel sc_log_global_log_level
Holds the global log level. Is the same as sc_log_config->log_level.
Definition: util-debug.c:95
SCError
Definition: util-error.h:29
pcre_extra * op_filter_regex_study
Definition: util-debug.h:184
char msg[SC_LOG_MAX_LOG_MSG_LEN]
Definition: util-debug.h:113
struct SCLogInitData_ SCLogInitData
Structure containing init data, that would be passed to SCInitDebugModule()
SCLogOPIfaceCtx * op_ifaces
Definition: util-debug.h:187
int SCLogDebugEnabled(void)
Returns whether debug messages are enabled to be logged or not.
Definition: util-debug.c:624
The output interface context for the logging module.
Definition: util-debug.h:121
pcre * op_filter_regex
Definition: util-debug.h:183
struct SCLogOPIfaceCtx_ SCLogOPIfaceCtx
The output interface context for the logging module.
SCLogOPBuffer * SCLogAllocLogOPBuffer(void)
Allocates an output buffer for an output interface. Used when we want the op_interface log_format to ...
Definition: util-debug.c:643
#define SCLogConfig(...)
Definition: util-debug.h:259
const char * log_format
Definition: util-debug.h:115
void SCLogDeInitLogModule(void)
De-Initializes the logging module.
Definition: util-debug.c:1468
SCError SCLogMessage(const SCLogLevel, const char *, const unsigned int, const char *, const SCError, const char *message)
Adds the global log_format to the outgoing buffer.
Definition: util-debug.c:541
const char * global_log_format
Definition: util-debug.h:162
struct SCLogOPIfaceCtx_ * next
Definition: util-debug.h:147
int sc_log_module_cleaned
Used to indicate whether the logging module has been cleaned or not.
Definition: util-debug.c:105
void SCLogInitLogModule(SCLogInitData *)
Initializes the logging module.
Definition: util-debug.c:1252
SCMutex fp_mutex
Definition: util-debug.h:145
void SCLogAppendOPIfaceCtx(SCLogOPIfaceCtx *, SCLogInitData *)
Appends an output_interface to the output_interface list sent in head.
Definition: util-debug.c:1167
char * op_filter
Definition: util-debug.h:181