From c04ad4b4ab667ac9bd796c20ab3a797f3e08d6b2 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 24 Aug 2020 16:52:20 +0200 Subject: [PATCH] Add extra debug logging. --- src/document.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/document.cpp b/src/document.cpp index 1c53229..81b30cb 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -54,6 +54,7 @@ Document::Document(Config &cfg) , _profiledata{_cfg.profiledata} { RestClient::init(); + BOOST_LOG_TRIVIAL(debug) << "Initialized RestClient."; download(); } @@ -65,12 +66,20 @@ Document::~Document() void Document::download(const string &uri, const bool temp_redirect) { + BOOST_LOG_TRIVIAL(debug) << "Downloading <" << uri << "> …"; RestClient::Connection connection{uri}; connection.SetUserAgent(string("mastorss/").append(version)); connection.FollowRedirects(false); 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) { case 200: @@ -104,7 +113,7 @@ void Document::download(const string &uri, const bool temp_redirect) case 303: case 307: { - temporary_redirect: +temporary_redirect: const string newuri{extract_location(response.headers)}; if (newuri.empty()) {