reactor-c
C Runtime for Lingua Franca
|
#include <stdarg.h>
Go to the source code of this file.
Macros | |
#define | ATTRIBUTE_FORMAT_PRINTF(f, s) |
#define | LOG_LEVEL_ERROR 0 |
#define | LOG_LEVEL_WARNING 1 |
#define | LOG_LEVEL_INFO 2 |
#define | LOG_LEVEL_LOG 3 |
#define | LOG_LEVEL_DEBUG 4 |
#define | LOG_LEVEL_ALL 255 |
Typedefs | |
typedef void | print_message_function_t(const char *, va_list) |
Functions | |
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 | lf_print_debug (const char *format,...) ATTRIBUTE_FORMAT_PRINTF(1 |
void void void void | lf_print_error (const char *format,...) ATTRIBUTE_FORMAT_PRINTF(1 |
void void void void void | lf_print_warning (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,...) |
void | lf_register_print_function (print_message_function_t *function, int log_level) |
#define LOG_LEVEL_ALL 255 |
#define LOG_LEVEL_DEBUG 4 |
#define LOG_LEVEL_ERROR 0 |
LOG_LEVEL is set in generated code to 0 through 4 if the target logging property is error, warning, info, log, or debug. The default level is info (2). Currently, 0, 1, and 2 are treated identically and lf_print_error, lf_print_warning, and lf_print all result in printed output. If log is set (3), then LOG_DEBUG messages will be printed as well. If debug is set (4), the LF_PRINT_DEBUG messages will be printed as well.
#define LOG_LEVEL_INFO 2 |
#define LOG_LEVEL_LOG 3 |
#define LOG_LEVEL_WARNING 1 |
Message print function type. The arguments passed to one of these print functions are a printf-style format string followed by a printf-style argument list collected into a va_list (variable argument list).
Report an informational message on stdout with a newline appended at the end. If this execution is federated, then the message will be prefaced by identifying information for the federate. The arguments are just like printf().
Report an debug message on stdout with the prefix "DEBUG: " and a newline appended at the end. If this execution is federated, then the message will be prefaced by identifying information for the federate. The arguments are just like printf().
Report an error with the prefix "ERROR: " and a newline appended at the end. The arguments are just like printf().
Report an error with the prefix "ERROR: " and a newline appended at the end, then exit with the failure code EXIT_FAILURE. The arguments are just like printf().
Report an error and exit just like lf_print_error_and_exit(), but also print the system error message associated with the error.
Report an log message on stdout with the prefix "LOG: " and a newline appended at the end. If this execution is federated, then the message will be prefaced by identifying information for the federate. The arguments are just like printf().
Report a warning with the prefix "WARNING: " and a newline appended at the end. The arguments are just like printf().
void lf_register_print_function | ( | print_message_function_t * | function, |
int | log_level ) |
Register a function to display messages. After calling this, all messages passed to the above print functions will be printed using the specified function rather than printf if their log level is greater than the specified level. The level should be one of LOG_LEVEL_ERROR, LOG_LEVEL_WARNING, LOG_LEVEL_INFO, LOG_LEVEL_LOG, or LOG_LEVEL_DEBUG.
function | The print message function or NULL to revert to using printf. |
log_level | The level of messages to redirect. |