Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable verbose log for this node request module?

How to enable verbose log for the following node request module?

https://github.com/mikeal/request

 var reqParam = {             'headers': {                 'User-Agent': 'CLA'             },             'body': 'CSCCDDSADADDADADADAAAEE',              'strictSSL': true,             'jar': false,             'encoding': null,             'timeout': 300000         };    request.post(reqParam, function (err, res, body) {                        if (err) {            console.log('Curl request received an error:' + err);           }     console.log(body);   }; 

What is the option which will enable http VERBOSE log for the https://github.com/mikeal/request module ??

like image 587
Somnath Avatar asked Jan 14 '14 06:01

Somnath


People also ask

How do I read a node JS log file?

I used to following code by using the Tail package which worked: const filepath = "path/to/file"; var Tail = require('tail'). Tail; var options = {fromBeginning: true}; var tail = new Tail(filepath, options); tail. on('line', function(data) { //do something with data }); tail. on("error", function(error) { console.

How do I run a node inspect?

Using the Node. To connect to it, open up Google Chrome and enter about:inspect into the URL bar and press Enter. Afterward, you will be redirected to chrome://inspect/ and be presented with a list of available devices to debug. If successful, your screen should show something similar to the image below.


1 Answers

Do you mean debug?

NODE_DEBUG=request node yourscript.js 
like image 129
cyberwombat Avatar answered Sep 27 '22 21:09

cyberwombat