1 #ifndef INC_SRT_HAICRYPT_LOG_H 2 #define INC_SRT_HAICRYPT_LOG_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 #define HAICRYPT_DECLARE_LOG_DISPATCHER(LOGLEVEL) \ 9 int HaiCrypt_LogF_##LOGLEVEL ( const char* file, int line, const char* function, const char* format, ...) 10 11 // Now declare all dispatcher functions 12 13 HAICRYPT_DECLARE_LOG_DISPATCHER(LOG_DEBUG); 14 HAICRYPT_DECLARE_LOG_DISPATCHER(LOG_NOTICE); 15 HAICRYPT_DECLARE_LOG_DISPATCHER(LOG_INFO); 16 HAICRYPT_DECLARE_LOG_DISPATCHER(LOG_WARNING); 17 HAICRYPT_DECLARE_LOG_DISPATCHER(LOG_ERR); 18 HAICRYPT_DECLARE_LOG_DISPATCHER(LOG_CRIT); 19 HAICRYPT_DECLARE_LOG_DISPATCHER(LOG_ALERT); 20 HAICRYPT_DECLARE_LOG_DISPATCHER(LOG_EMERG); 21 22 #define HCRYPT_LOG_INIT() 23 #define HCRYPT_LOG_EXIT() 24 #define HCRYPT_LOG(lvl, fmt, ...) HaiCrypt_LogF_##lvl (__FILE__, __LINE__, __FUNCTION__, fmt, __VA_ARGS__) 25 26 #if ENABLE_HAICRYPT_LOGGING == 2 27 #define HCRYPT_DEV 1 28 #endif 29 30 #ifdef __cplusplus 31 } 32 #endif 33 34 #endif // macroguard 35