reactor-c
C Runtime for Lingua Franca
|
#include "logging.h"
Go to the source code of this file.
Macros | |
#define | LOG_LEVEL LOG_LEVEL_INFO |
#define | LF_PRINT_LOG(format, ...) |
#define | LF_PRINT_DEBUG(format, ...) |
#define | LF_ASSERT(condition, format, ...) |
#define | LF_ASSERTN(condition, format, ...) |
#define | LF_ASSERT_NON_NULL(pointer) |
#define LF_ASSERT | ( | condition, | |
format, | |||
... ) |
Assertion handling. LF_ASSERT can be used as a shorthand for verifying a condition and calling lf_print_error_and_exit
if it is not true. The LF_ASSERT version requires that the condition evaluate to true (non-zero), whereas the LF_ASSERTN version requires that the condition evaluate to false (zero). These are optimized to execute the condition argument but not check the result if the NDEBUG flag is defined. The NDEBUG flag will be defined if the user specifies build-type: Release
in the target properties of the LF program.
LF_ASSERT_NON_NULL can be used to verify that a pointer is not NULL. It differs from LF_ASSERT in that it does nothing at all if the NDEBUG flag is defined.
#define LF_ASSERT_NON_NULL | ( | pointer | ) |
#define LF_ASSERTN | ( | condition, | |
format, | |||
... ) |
#define LF_PRINT_DEBUG | ( | format, | |
... ) |
A macro used to print useful debug information. It can be enabled by setting the target property 'logging' to 'DEBUG' or by defining LOG_LEVEL to 2 in the top-level preamble. The input to this macro is exactly like printf: (format, ...). "DEBUG: " is prepended to the beginning of the message and a newline is appended to the end of the message.
#define LF_PRINT_LOG | ( | format, | |
... ) |
A macro used to print useful logging information. It can be enabled by setting the target property 'logging' to 'LOG' or by defining LOG_LEVEL to LOG_LEVEL_LOG or LOG_LEVEL_DEBUG in the top-level preamble. The input to this macro is exactly like printf: (format, ...). "LOG: " is prepended to the beginning of the message and a newline is appended to the end of the message.
#define LOG_LEVEL LOG_LEVEL_INFO |
Non-C implementations (which cannot benefit from the C preprocessor) should ignore this file, or merely use it as a suggestion for similar behavior that they should implement using whatever metaprogramming facilities their implementation provides in place of the preprocessor. Default log level.