Send curl debug to stdcerr

This commit is contained in:
Jan Kaluza 2012-08-20 12:42:10 +02:00
parent a5cf593fb7
commit 27e0dd7bb5
3 changed files with 14 additions and 4 deletions

View file

@ -2,6 +2,16 @@
#include "twitcurl.h"
#include "urlencode.h"
static int myDebugCallback(CURL *,
curl_infotype type,
char *data,
size_t size,
void *handle)
{
std::cerr << std::string(data, size);
return 0;
};
/*++
* @method: twitCurl::twitCurl
*
@ -30,6 +40,8 @@ m_eProtocolType( twitCurlTypes::eTwitCurlProtocolHttp )
std::string dummyStr;
getLastCurlError( dummyStr );
}
curl_easy_setopt(m_curlHandle, CURLOPT_VERBOSE, 1);
curl_easy_setopt(m_curlHandle, CURLOPT_DEBUGFUNCTION, myDebugCallback);
}
/*++

View file

@ -236,8 +236,6 @@
REQUIRED_VARS
OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR
VERSION_VAR
OPENSSL_VERSION
FAIL_MESSAGE
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
)

View file

@ -66,8 +66,8 @@ protected:
virtual std::streamsize xsputn(const char *msg, std::streamsize count){
//Output to log4cxx logger
std::string s(msg,count);
LOG4CXX_INFO(_logger, msg);
std::string s(msg, count - 1); // remove last \n
LOG4CXX_INFO(_logger, s);
return count;
}