Skip to content

Commit

Permalink
Use debug() to log http request to karotz
Browse files Browse the repository at this point in the history
  • Loading branch information
oeuillot committed Nov 6, 2015
1 parent 4edbe2c commit 0122102
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions lib/openkarotz-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

var request = require('request');


var debug = require('debug')('openkarotz');



Expand Down Expand Up @@ -73,9 +73,11 @@ var openKarotz = function(ip) {
},
function(error, response, body) {

//console.log(url() + api + '?' + serialize(params));
//console.log(error);
//console.log(response);
if (debug.enabled) {
debug("Request="+url() + api + '?' + serialize(params));
debug("error=",error);
debug("response=",response);
}

if (!error && response && response.statusCode == 200) {

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"author": "Guillaume Wuip <clochard.guillaume@gmail.com> (http://wuips.com/guillaume/)",
"main": "./lib/openkarotz-wrapper.js",
"dependencies": {
"request" : "~2.33.0"
"request" : "~2.33.0",
"debug": "~2.2.0"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 0122102

Please sign in to comment.