#include <stdarg.h>
Go to the source code of this file.
◆ ATTRIBUTE_FORMAT_PRINTF
#define ATTRIBUTE_FORMAT_PRINTF |
( |
| f, |
|
|
| s ) |
◆ LOG_LEVEL_ALL
#define LOG_LEVEL_ALL 255 |
◆ LOG_LEVEL_DEBUG
#define LOG_LEVEL_DEBUG 4 |
◆ LOG_LEVEL_ERROR
#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.
◆ LOG_LEVEL_INFO
◆ LOG_LEVEL_LOG
◆ LOG_LEVEL_WARNING
#define LOG_LEVEL_WARNING 1 |
◆ print_message_function_t
typedef void print_message_function_t(const char *, va_list) |
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).
◆ lf_print()
void lf_print |
( |
const char * | format, |
|
|
| ... ) |
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().
◆ lf_print_debug()
void void void lf_print_debug |
( |
const char * | format, |
|
|
| ... ) |
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().
◆ lf_print_error()
void void void void lf_print_error |
( |
const char * | format, |
|
|
| ... ) |
Report an error with the prefix "ERROR: " and a newline appended at the end. The arguments are just like printf().
◆ lf_print_error_and_exit()
void void void void void void lf_print_error_and_exit |
( |
const char * | format, |
|
|
| ... ) |
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().
◆ lf_print_error_system_failure()
void void void void void void void lf_print_error_system_failure |
( |
const char * | format, |
|
|
| ... ) |
Report an error and exit just like lf_print_error_and_exit(), but also print the system error message associated with the error.
◆ lf_print_log()
void void lf_print_log |
( |
const char * | format, |
|
|
| ... ) |
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().
◆ lf_print_warning()
void void void void void lf_print_warning |
( |
const char * | format, |
|
|
| ... ) |
Report a warning with the prefix "WARNING: " and a newline appended at the end. The arguments are just like printf().
◆ lf_register_print_function()
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.
- Parameters
-
function | The print message function or NULL to revert to using printf. |
log_level | The level of messages to redirect. |