Common.h 1.3 KB

12345678910111213141516171819202122232425
  1. /*
  2. * Common.h
  3. *
  4. * Created on: 2021年8月7日
  5. * Author: Wendell
  6. */
  7. #ifndef COMMON_H_
  8. #define COMMON_H_
  9. #include <time.h>
  10. #define LOG_INFO(format, args...) StoreSysLogMsg("[%s:%4d][%s][Info] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
  11. #define LOG_WARN(format, args...) StoreSysLogMsg("[%s:%4d][%s][Warn] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
  12. #define LOG_ERROR(format, args...) StoreSysLogMsg("[%s:%4d][%s][Erro] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
  13. #define LOG_DBG(format, args...) StoreSysLogMsg("[%s:%4d][%s][Debg] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
  14. #define PSU_LOG(format, args...) StorePsuLogMsg("[%s:%4d][%s][Info] "format, (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), __LINE__, __FUNCTION__, ##args)
  15. int StoreSysLogMsg(const char *fmt, ...);
  16. int StorePsuLogMsg(const char *fmt, ...);
  17. void GetClockTime(struct timespec *_now_time);
  18. unsigned long GetTimeoutValue(struct timespec _start_time);
  19. unsigned long GetSecTimeoutValue(struct timespec _start_time);
  20. #endif /* COMMON_H_ */