From 7280c8cd82ee5081808bacd5597cf8b9ee3f4a10 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 29 Oct 2012 12:01:49 +0100 Subject: [PATCH] zoom: tweak logging for Torus fetch --- src/torus.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/torus.cpp b/src/torus.cpp index b5f0275..1313984 100644 --- a/src/torus.cpp +++ b/src/torus.cpp @@ -70,18 +70,25 @@ xmlDoc *mp::get_searchable(mp::Package &package, if (http_response && http_response->code == 200 && http_response->content_buf) { - package.log("zoom", YLOG_LOG, "Torus: %s OK", url_template.c_str()); doc = xmlParseMemory(http_response->content_buf, http_response->content_len); - + if (doc) + package.log("zoom", YLOG_LOG, "Torus: %s OK", + url_template.c_str()); + else + package.log("zoom", YLOG_WARN, "Torus: %s FAIL. XML parse failed", + url_template.c_str()); } else { - package.log("zoom", YLOG_WARN, "Torus: %s FAIL", url_template.c_str()); if (http_response) { - package.log("zoom", YLOG_LOG, "HTTP code: %d", http_response->code); + package.log("zoom", YLOG_WARN, "Torus: %s FAIL. HTTP code %d", + url_template.c_str(), http_response->code); } + else + package.log("zoom", YLOG_WARN, "Torus: %s FAIL. No HTTP response", + url_template.c_str()); } if (http_response && http_response->content_buf) -- 1.7.10.4