You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
830 B

2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
  1. #pragma once
  2. #include <stdint.h>
  3. #include <string>
  4. void zos_log(const char* fmt, ...);
  5. int32_t zos_get_ticket();
  6. std::string zhex2str(const uint8_t* hex, size_t len);
  7. std::string zhex2binary( uint8_t hex);
  8. #define ZLOGI(TAG, fmt, ...) zos_log("%08lu INFO [%-10s] " fmt "", zos_get_ticket(), TAG, ##__VA_ARGS__);
  9. #define ZLOGD(TAG, fmt, ...) zos_log("%08lu DEBU [%-10s] " fmt "", zos_get_ticket(), TAG, ##__VA_ARGS__);
  10. #define ZLOGE(TAG, fmt, ...) zos_log("%08lu ERRO [%-10s] " fmt "", zos_get_ticket(), TAG, ##__VA_ARGS__);
  11. #define ZLOGW(TAG, fmt, ...) zos_log("%08lu WARN [%-10s] " fmt "", zos_get_ticket(), TAG, ##__VA_ARGS__);
  12. #define ZASSERT(cond) \
  13. if (!(cond)) { \
  14. ZLOGE("ASSERT", "condition: %s", #cond); \
  15. exit(-1); \
  16. }