From e93c2d1736bd2e08f9800f6d12bbe034194a38ad Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 13 Nov 2017 23:03:39 +0100 Subject: main(): Increase log verbosity to `Trace` By default, 'stderrlog' uses the `Error` level (which I found out by inspecting the source here: https://docs.rs/stderrlog/0.2.3/src/stderrlog/lib.rs.html#242-253). Increase the log verbosity to `Trace` to hopefully give us more information to act on. Bug hunting. --- src/main.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index dc9bcc9..05ca775 100644 --- a/src/main.rs +++ b/src/main.rs @@ -111,6 +111,7 @@ fn main() { stderrlog::new() .module(module_path!()) .timestamp(stderrlog::Timestamp::Second) + .verbosity(4) // LogLevel::Trace .init() .expect("Logger failed to initialise"); -- cgit v1.2.3 From 00fc313eb14248401bc3b1863334f4b0c268007d Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 13 Nov 2017 23:06:03 +0100 Subject: 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. --- src/github.rs | 4 +++- src/jenkins.rs | 4 ++++ src/lib.rs | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src') 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) diff --git a/src/lib.rs b/src/lib.rs index a526783..d106d16 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,6 +15,9 @@ // You should have received a copy of the GNU General Public License // along with Kipper. If not, see . +#[macro_use] +extern crate log; + pub mod jenkins; pub mod pull_request; -- cgit v1.2.3 From df9b4dbd7aa8401b0e488c99c49205bc39dc5a80 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 13 Nov 2017 23:07:28 +0100 Subject: Focus HTTP response logging on `update_commit_status()` Comment out HTTP response logging from Jenkins because those may be coming back all right. Actually I might want to leave the log from `request_job()` now that I think about it. Add some additional logging on `update_commit_status()` to hopefully try to see why it's not getting called all the time. --- src/github.rs | 3 +++ src/jenkins.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/github.rs b/src/github.rs index 9b95192..44a4419 100644 --- a/src/github.rs +++ b/src/github.rs @@ -93,6 +93,9 @@ pub fn update_commit_status( .json(¶ms) .send()?; + debug!("{}", response.url()); + debug!("{}", response.status()); + debug!("{}", response.headers()); debug!("{}", response.text()?); Ok(()) diff --git a/src/jenkins.rs b/src/jenkins.rs index c954846..61d3bf1 100644 --- a/src/jenkins.rs +++ b/src/jenkins.rs @@ -231,7 +231,7 @@ pub fn get_jobs( let body = response.text()?; - debug!("{}", body); + // debug!("{}", body); let jobs = json::parse(body.as_ref())?; @@ -257,7 +257,7 @@ pub fn request_job( let body = response.text()?; - debug!("{}", body); + // debug!("{}", body); let job = Job::new(body)?; -- cgit v1.2.3