Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

41 wiersze
1.1 KiB

  1. #pragma once
  2. #cmakedefine CPPMICROHTTPD_DEBUG
  3. #cmakedefine CPPMICROHTTPD_LOGGING_NONE
  4. #cmakedefine CPPMICROHTTPD_LOGGING_STDCOUT
  5. #cmakedefine CPPMICROHTTPD_LOGGING_CPPLOGGING
  6. namespace __impl
  7. {
  8. struct fake_log
  9. {
  10. template<typename... T_args>
  11. fake_log& operator << (T_args&&...)
  12. { return *this; }
  13. };
  14. }
  15. #if defined(CPPMICROHTTPD_LOGGING_CPPLOGGING)
  16. #include <cpplogging/interface.h>
  17. #define cppmicrohttpd_log(p_level) \
  18. cpplogging_global_log(p_level)
  19. #define cppmicrohttpd_log_debug(...) \
  20. cppmicrohttpd_log(debug) << __VA_ARGS__
  21. #elif defined(CPPMICROHTTPD_LOGGING_STDCOUT)
  22. #include <iostream>
  23. #define cppmicrohttpd_log(p_level) \
  24. ::std::cout << #p_level << ' ' << __FILE__ << ':' << __LINE__ << " - "
  25. #ifdef CPPMICROHTTPD_DEBUG
  26. #define cppmicrohttpd_log_debug(...) \
  27. cppmicrohttpd_log(debug) << __VA_ARGS__
  28. #else
  29. #define cppmicrohttpd_log_debug(...) \
  30. __impl::fake_log()
  31. #endif
  32. #else
  33. #define cppmicrohttpd_log(...) \
  34. __impl::fake_log()
  35. #define cppmicrohttpd_log_debug(...) \
  36. __impl::fake_log()
  37. #endif