1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2024-12-01 00:45:41 +00:00

Print to stderr otherwise it disturbs the response.

This commit is contained in:
King_DuckZ 2017-04-06 21:47:28 +01:00
parent 98d98fc4ba
commit e32cecedba

View file

@ -16,7 +16,7 @@ namespace tawashi {
struct CurlDeleter { struct CurlDeleter {
void operator() (CURL* parCurl) const { void operator() (CURL* parCurl) const {
#if defined(CURL_WRAPPER_VERBOSE) #if defined(CURL_WRAPPER_VERBOSE)
std::cout << "Deleting CURL* " << parCurl << " and cleaning up\n"; std::cerr << "Deleting CURL* " << parCurl << " and cleaning up\n";
#endif #endif
assert(parCurl); assert(parCurl);
curl_easy_cleanup(parCurl); curl_easy_cleanup(parCurl);
@ -37,17 +37,17 @@ namespace tawashi {
static std::weak_ptr<CURL> curl; static std::weak_ptr<CURL> curl;
#if defined(CURL_WRAPPER_VERBOSE) #if defined(CURL_WRAPPER_VERBOSE)
std::cout << "CURL object requested\n"; std::cerr << "CURL object requested\n";
#endif #endif
auto shared = curl.lock(); auto shared = curl.lock();
if (not shared) { if (not shared) {
#if defined(CURL_WRAPPER_VERBOSE) #if defined(CURL_WRAPPER_VERBOSE)
std::cout << "CURL weak pointer has expired! Calling curl_global_init()\n"; std::cerr << "CURL weak pointer has expired! Calling curl_global_init()\n";
#endif #endif
if (curl_global_init(CURL_GLOBAL_ALL)) if (curl_global_init(CURL_GLOBAL_ALL))
return CurlWrapper::CurlPtr(); return CurlWrapper::CurlPtr();
#if defined(CURL_WRAPPER_VERBOSE) #if defined(CURL_WRAPPER_VERBOSE)
std::cout << "Calling curl_easy_init()\n"; std::cerr << "Calling curl_easy_init()\n";
#endif #endif
shared.reset(curl_easy_init(), CurlDeleter()); shared.reset(curl_easy_init(), CurlDeleter());
@ -58,7 +58,7 @@ namespace tawashi {
curl = shared; curl = shared;
} }
#if defined(CURL_WRAPPER_VERBOSE) #if defined(CURL_WRAPPER_VERBOSE)
std::cout << "CURL shared pointer ready: " << shared.get() << '\n'; std::cerr << "CURL shared pointer ready: " << shared.get() << '\n';
#endif #endif
assert(shared); assert(shared);
return shared; return shared;