reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
logging.h
Go to the documentation of this file.
1#include <stdarg.h>
2
3// To silence warnings about a function being a candidate for format checking
4// with gcc, add an attribute.
5// The arguments are the position of the format string (starting with 1)
6// and the start of the remaining arguments, or 0 for vprintf style functions.
7#if defined(__GNUC__)
8#define ATTRIBUTE_FORMAT_PRINTF(f, s) __attribute__((format(printf, f, s)))
9#else
10#define ATTRIBUTE_FORMAT_PRINTF(f, s)
11#endif
12
24#define LOG_LEVEL_ERROR 0
25#define LOG_LEVEL_WARNING 1
26#define LOG_LEVEL_INFO 2
27#define LOG_LEVEL_LOG 3
28#define LOG_LEVEL_DEBUG 4
29#define LOG_LEVEL_ALL 255
30
36void lf_print(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
37
43void lf_print_log(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
44
50void lf_print_debug(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
51
56void lf_print_error(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
57
62void lf_print_warning(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
63
69void lf_print_error_and_exit(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
70
75void lf_print_error_system_failure(const char* format, ...);
76
83typedef void(print_message_function_t)(const char*, va_list);
84
97void lf_register_print_function(print_message_function_t* function, int log_level);
#define ATTRIBUTE_FORMAT_PRINTF(f, s)
Definition logging.h:10
void void void lf_print_debug(const char *format,...) ATTRIBUTE_FORMAT_PRINTF(1
void void void void void lf_print_warning(const char *format,...) ATTRIBUTE_FORMAT_PRINTF(1
void lf_register_print_function(print_message_function_t *function, int log_level)
Definition util.c:215
void lf_print(const char *format,...) ATTRIBUTE_FORMAT_PRINTF(1
void void lf_print_log(const char *format,...) ATTRIBUTE_FORMAT_PRINTF(1
void void void void void void lf_print_error_and_exit(const char *format,...) ATTRIBUTE_FORMAT_PRINTF(1
void void void void void void void lf_print_error_system_failure(const char *format,...)
Definition util.c:204
void print_message_function_t(const char *, va_list)
Definition logging.h:83
void void void void lf_print_error(const char *format,...) ATTRIBUTE_FORMAT_PRINTF(1