Du kan inte välja fler än 25 ämnen
Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
|
- #pragma once
-
- #cmakedefine CPPMICROHTTPD_DEBUG
- #cmakedefine CPPMICROHTTPD_LOGGING_NONE
- #cmakedefine CPPMICROHTTPD_LOGGING_STDCOUT
- #cmakedefine CPPMICROHTTPD_LOGGING_CPPLOGGING
-
- namespace __impl
- {
- struct fake_log
- {
- template<typename... T_args>
- fake_log& operator << (T_args&&...)
- { return *this; }
- };
- }
-
- #if defined(CPPMICROHTTPD_LOGGING_CPPLOGGING)
- #include <cpplogging/interface.h>
- #define cppmicrohttpd_log(p_level) \
- cpplogging_global_log(p_level)
- #define cppmicrohttpd_log_debug(...) \
- cppmicrohttpd_log(debug) << __VA_ARGS__
- #elif defined(CPPMICROHTTPD_LOGGING_STDCOUT)
- #include <iostream>
- #define cppmicrohttpd_log(p_level) \
- ::std::cout << #p_level << ' ' << __FILE__ << ':' << __LINE__ << " - "
- #ifdef CPPMICROHTTPD_DEBUG
- #define cppmicrohttpd_log_debug(...) \
- cppmicrohttpd_log(debug) << __VA_ARGS__
- #else
- #define cppmicrohttpd_log_debug(...) \
- __impl::fake_log()
- #endif
- #else
- #define cppmicrohttpd_log(...) \
- __impl::fake_log()
- #define cppmicrohttpd_log_debug(...) \
- __impl::fake_log()
- #endif
|