From 6a1eb5fbfa246c890f4e975ef65d68e29893c8a7 Mon Sep 17 00:00:00 2001 From: Bertrand Cournaud Date: Fri, 8 Jan 2016 10:27:20 +0100 Subject: [PATCH] Github: Add debug + clean output --- apps/github/mode/stats.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/github/mode/stats.pm b/apps/github/mode/stats.pm index b47e042f6..12a8fc354 100644 --- a/apps/github/mode/stats.pm +++ b/apps/github/mode/stats.pm @@ -79,10 +79,9 @@ sub run { }; if ($@) { + use Data::Dumper; $self->{output}->add_option_msg(short_msg => "Cannot decode json response"); - use Data::Dumper; - print Dumper($jsoncontent); - + $self->{output}->output_add(long_msg => Data::Dumper::Dumper(), debug => 1); $self->{output}->option_exit(); } @@ -91,7 +90,7 @@ sub run { my $stars = $webcontent->{watchers_count}; $self->{output}->output_add(severity => "OK", - short_msg => sprintf("%d forks\n%d watchers\n%d stars", $forks, $watchers, $stars)); + short_msg => sprintf("%d forks - %d watchers - %d stars", $forks, $watchers, $stars)); $self->{output}->perfdata_add(label => 'forks', value => $forks);