Defines |
#define | mf_print_array(ar, size, typ) { for(int i=0; i < size; ++i){ fprintf(utv_log_out,typ,ar[i]); fprintf(utv_log_out,", "); } fprintf(utv_log_out,"\n"); } |
#define | MF_FILE_NAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) |
#define | mf_debug(M,...) fprintf(utv_log_out, "%s[DEBUG] %s:%d: " M "\n", utr_log_pre(), MF_FILE_NAME, __LINE__, ##__VA_ARGS__) |
#define | mf_check_debug(A, M,...) if(!(A)) { mf_debug(M, ##__VA_ARGS__); assert(!M); } |
#define | mfp_debug mf_debug |
#define | mfp_check_debug mf_check_debug |
#define | mf_log_err(M,...) { fprintf(utv_log_out, "%s[ERROR] (%s:%d ) " M "\n", utr_log_pre(), MF_FILE_NAME, __LINE__, ##__VA_ARGS__) ; fflush(utv_log_out); } |
#define | mf_fatal_err(M,...) { fprintf(utv_log_out, "%s[FATAL ERROR] (%s:%d ) " M "\n", utr_log_pre(), MF_FILE_NAME, __LINE__, ##__VA_ARGS__); fflush(utv_log_out); exit(-3); } |
#define | mf_log_warn(M,...) fprintf(utv_log_out, "%s[WARN] " M "\n", utr_log_pre(), ##__VA_ARGS__) |
#define | mf_log_info(M,...) fprintf(utv_log_out, "%s[INFO] " M "\n", utr_log_pre() , ##__VA_ARGS__) |
#define | mf_log_test_fail(M,...) fprintf(utv_log_out, "%s[TEST FAILED] (%s:%d ) " M "\n", utr_log_pre(), MF_FILE_NAME, __LINE__, ##__VA_ARGS__) |
#define | mf_check(A, M,...) if(!(A)) { mf_log_err(M, ##__VA_ARGS__); assert(!M); exit(-1);} |
#define | mf_sentinel(M,...) { mf_log_err(M, ##__VA_ARGS__); } |
#define | mf_check_mem(A) mf_check((A), "%s[ERROR]Out of memory.", utr_log_pre()) |
#define | mf_check_info(A, M,...) if(!(A)) { mf_log_info(M,##__VA_ARGS__); } |
#define | mf_test(A, M,...) if(!(A)) { mf_log_test_fail(M, ##__VA_ARGS__); assert(!M);} |
Functions |
const char * | utr_log_pre () |
Variables |
FILE * | utv_log_out |
| For logging support.
|
This file is ONLY for debugging/logging/checking macros. Do not add any other macros/functions/etc. which are used during computations. K.Michalik - 10.2013 initial version K.Michalik - 04.2014 Interactive_output access.