include/uth_log.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
Include dependency graph for uth_log.h:

Go to the source code of this file.

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.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 3 Jun 2020 for ModFEM by  doxygen 1.6.1