haicrypt_log.h 921 B

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