I have Log functions. Macro'ed up a bit to be confusing. I recently had to rewrite them and while they got cleaner, the example above no longer works.
I'd like it to work again! Not sure how to get there. It seems to be attempting to print the pointer address of the function, instead of performing the function and using the result pointer. So the log entry looks something like "This used to work 6100333B"
//LogXXX is a maco
#define LogInfo(...) \
log_expansion(LOG_OPTIONS, LOG_LEVEL_INFO, __VA_ARGS__)
// Which expands to a temporary macro expansion to add constant data
#define log_expansion(LOG_OPTIONS, \
MESSAGE_LOG_LEVEL, \
...) \
log_formatter(LOG_OPTIONS, \
LIBRARY_LOG_LEVEL, \
LIBRARY_LOG_NAME, \
MESSAGE_LOG_LEVEL, \
NULL, \
0, \
__VA_ARGS__)
// log_formatter will get the data to a queue that is then later printed out. Think snprintf and printf.
Also not working LogInfo("Feature is: %s", FEATURE_ON_BOOL ? "ON" : "OFF"); For the same cause I think.
I don't know what I need. Could be as easy as a well placed () or a do while(0). I don't see it yet. Thoughts?