diff options
author | Teddy Wing | 2017-11-13 23:06:03 +0100 |
---|---|---|
committer | Teddy Wing | 2017-11-13 23:06:03 +0100 |
commit | 00fc313eb14248401bc3b1863334f4b0c268007d (patch) | |
tree | e3e65a9f4f10bcbe1dc8ec2d76a1b32af77a83ee | |
parent | e93c2d1736bd2e08f9800f6d12bbe034194a38ad (diff) | |
download | kipper-00fc313eb14248401bc3b1863334f4b0c268007d.tar.bz2 |
Log response body of HTTP calls
Log the HTTP response bodies to see if there's something we can gather
from our connected services' API responses.
-rw-r--r-- | src/github.rs | 4 | ||||
-rw-r--r-- | src/jenkins.rs | 4 | ||||
-rw-r--r-- | src/lib.rs | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/github.rs b/src/github.rs index 4267468..9b95192 100644 --- a/src/github.rs +++ b/src/github.rs @@ -69,7 +69,7 @@ pub fn update_commit_status( params.insert("description", d); } - client.post( + let mut response = client.post( &format!( "{}/repos/{}/{}/statuses/{}", API_URL, @@ -93,6 +93,8 @@ pub fn update_commit_status( .json(¶ms) .send()?; + debug!("{}", response.text()?); + Ok(()) } diff --git a/src/jenkins.rs b/src/jenkins.rs index 5cd3bbe..c954846 100644 --- a/src/jenkins.rs +++ b/src/jenkins.rs @@ -231,6 +231,8 @@ pub fn get_jobs( let body = response.text()?; + debug!("{}", body); + let jobs = json::parse(body.as_ref())?; Ok( @@ -255,6 +257,8 @@ pub fn request_job( let body = response.text()?; + debug!("{}", body); + let job = Job::new(body)?; Ok(job) @@ -15,6 +15,9 @@ // You should have received a copy of the GNU General Public License // along with Kipper. If not, see <http://www.gnu.org/licenses/>. +#[macro_use] +extern crate log; + pub mod jenkins; pub mod pull_request; |