SystemLogMessage.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Module_CCS.c
  3. *
  4. * Created on: 2020/03/16
  5. * Author: foluswen
  6. */
  7. #ifndef SystemLogMessage_H
  8. #define SystemLogMessage_H
  9. #define SystemLogMessage //for engineer to do analysis
  10. //#define ConsloePrintLog
  11. #define SAVE_SYS_LOG_MSG_EVCOMM
  12. //#define DEBUG_PRINTF_EVCOMM_DETAIL_SHOW
  13. // Normal debug Message
  14. #ifdef SAVE_SYS_LOG_MSG_EVCOMM
  15. #define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
  16. #define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
  17. #define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
  18. #else
  19. #define DEBUG_INFO(...)
  20. #define DEBUG_WARN(...)
  21. #define DEBUG_ERROR(...)
  22. #endif
  23. // Detail debug Message, will effect SLAC if enable
  24. #ifdef DEBUG_PRINTF_EVCOMM_DETAIL_SHOW
  25. #define DEBUG_PRINTF_EVCOMM_DETAIL(format, args...) StoreLogMsg("[%s:%d][%s][Detail] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
  26. #else
  27. #define DEBUG_PRINTF_EVCOMM_DETAIL(...)
  28. #endif
  29. int StoreLogMsg(const char *fmt, ...);
  30. #endif