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.

31 lines
991 B

  1. #pragma once
  2. #cmakedefine CPPMICROHTTPD_DEBUG
  3. #cmakedefine CPPMICROHTTPD_LOGGING_NONE
  4. #cmakedefine CPPMICROHTTPD_LOGGING_STDCOUT
  5. #cmakedefine CPPMICROHTTPD_LOGGING_CPPLOGGING
  6. #if defined(CPPMICROHTTPD_LOGGING_CPPLOGGING)
  7. #include <cpplogging/interface.h>
  8. #define cppmicrohttpd_log(p_level) \
  9. cpplogging_global_log(p_level)
  10. #define cppmicrohttpd_log_debug(...) \
  11. cppmicrohttpd_log(debug) << __VA_ARGS__
  12. #elif defined(CPPMICROHTTPD_LOGGING_STDCOUT)
  13. #include <iostream>
  14. #define cppmicrohttpd_log(p_level) \
  15. ::std::cout << #p_level << ' ' << __FILE__ << ':' << __LINE__ << " - "
  16. #ifdef CPPMICROHTTPD_DEBUG
  17. #define cppmicrohttpd_log_debug(...) \
  18. cppmicrohttpd_log(debug) << __VA_ARGS__
  19. #else
  20. #define cppmicrohttpd_log_debug(...) \
  21. do { } while (0)
  22. #endif
  23. #else
  24. #define cppmicrohttpd_log(...) \
  25. do { } while (0)
  26. #define cppmicrohttpd_log_debug(...) \
  27. do { } while (0)
  28. #endif