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.

Logs.h 666B

123456789101112131415161718192021222324
  1. #pragma once
  2. #if APP_CORE_LOGS
  3. #define APP_CORE_LOGS_LEVEL 1
  4. #define LOG(level_, ...) do { \
  5. if (level_ <= APP_CORE_LOGS_LEVEL) \
  6. { \
  7. char tmp[100]; \
  8. snprintf(tmp, sizeof(tmp), __VA_ARGS__); \
  9. Serial.println(tmp); \
  10. } \
  11. } while (0)
  12. #define LOG_FN_BEGIN(level_) LOG(level_, "%s: Begin", __FUNCTION__)
  13. #define LOG_FN_END(level_) LOG(level_, "%s: End", __FUNCTION__)
  14. #else
  15. #define LOG(x)
  16. #define LOG(x, ...)
  17. #endif