15#define GENERAL_DEBUG 1
20#define GENERAL_DEBUG 0
34#define STRINGIFY(x) #x
36#define TOSTRING(x) STRINGIFY(x)
46#define LOG_DEBUG(formatted_string, ...) \
48 printf("\e[0;32m" DEBUG "( " __FILE__ ": " TOSTRING(__LINE__) " )" \
50 " " formatted_string, \
57#define LOG_FUNCTION_CALL(fn_name) LOG_DEBUG(#fn_name " was called.\n");
62#define LOG_FUNCTION_BACK(fn_name) LOG_DEBUG("Back in " #fn_name "\n");
67#define TYPE_CALL_ADDRESS 0
72#define TYPE_CALL_VALUE 1
76#define TCA TYPE_CALL_ADDRESS
80#define TCV TYPE_CALL_VALUE
92#define LOG_PARAMETER(ordinal_number, type, type_call, fmt, ...) \
93 LOG_DEBUG(#ordinal_number " parameter (type: " #type ") with %s " fmt, \
94 (type_call == TYPE_CALL_ADDRESS ? "address" : "value"), ##__VA_ARGS__)
105#define LOG_RETURN(type, type_call, fmt, ...) \
106 LOG_DEBUG("Returning (type: " #type ") %s " fmt, (type_call == TYPE_CALL_ADDRESS ? "address" : "value"), \
114#define LOG_DEBUG(formated_string, ...)
115#define LOG_FUNCTION_CALL(fn_name)
116#define LOG_FUNCTION_BACK(fn_name)
117#define LOG_PARAMETER(ordinal_number, type_str, type_call, fmt, ...)
118#define LOG_RETURN(type_str, type_call, fmt, ...)
123#define TYPE_CALL_ADDRESS 0
124#define TYPE_CALL_VALUE 0
Various constants for the log header file.