Add extra debug logging.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2020-08-24 16:52:20 +02:00
parent 739f5d4b3b
commit c04ad4b4ab
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 10 additions and 1 deletions

View File

@ -54,6 +54,7 @@ Document::Document(Config &cfg)
, _profiledata{_cfg.profiledata} , _profiledata{_cfg.profiledata}
{ {
RestClient::init(); RestClient::init();
BOOST_LOG_TRIVIAL(debug) << "Initialized RestClient.";
download(); download();
} }
@ -65,12 +66,20 @@ Document::~Document()
void Document::download(const string &uri, const bool temp_redirect) void Document::download(const string &uri, const bool temp_redirect)
{ {
BOOST_LOG_TRIVIAL(debug) << "Downloading <" << uri << "> …";
RestClient::Connection connection{uri}; RestClient::Connection connection{uri};
connection.SetUserAgent(string("mastorss/").append(version)); connection.SetUserAgent(string("mastorss/").append(version));
connection.FollowRedirects(false); connection.FollowRedirects(false);
RestClient::Response response{connection.get("")}; RestClient::Response response{connection.get("")};
BOOST_LOG_TRIVIAL(debug) << "Got response: " << response.code;
BOOST_LOG_TRIVIAL(debug) << "Got Headers:";
for (const auto &header : response.headers)
{
BOOST_LOG_TRIVIAL(debug) << header.first << ": " << header.second;
}
switch (response.code) switch (response.code)
{ {
case 200: case 200:
@ -104,7 +113,7 @@ void Document::download(const string &uri, const bool temp_redirect)
case 303: case 303:
case 307: case 307:
{ {
temporary_redirect: temporary_redirect:
const string newuri{extract_location(response.headers)}; const string newuri{extract_location(response.headers)};
if (newuri.empty()) if (newuri.empty())
{ {