Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add debug calls? #120

Open
starpit opened this issue Jun 25, 2018 · 4 comments
Open

add debug calls? #120

starpit opened this issue Jun 25, 2018 · 4 comments

Comments

@starpit
Copy link
Contributor

starpit commented Jun 25, 2018

would it make sense to sprinkle the code with debug calls? personally, i would find this helpful for debugging.

@jthomas
Copy link
Member

jthomas commented Jun 26, 2018

This is a good idea. The needle library uses the debug package for a similar purpose.
https://www.npmjs.com/package/debug

I've used the DEBUG=needle flag before to get more dump the request/responses to the console but it doesn't include everything.

Do we want to follow that approach?

@starpit
Copy link
Contributor Author

starpit commented Jun 26, 2018

yes. i think the main missing pieces from needle are the body of the request and of the response. needle also includes too much information generally (though sometimes the extra info helps). finally, if a program is using needle for more than one purpose, having the ability to log just our requests is helpful.

e.g. too much info, and yet too little:

  needle Got response 200 { 'x-backside-transport': 'OK OK',
  connection: 'close',
  'transfer-encoding': 'chunked',
  server: 'nginx',
  date: 'Tue, 26 Jun 2018 11:53:38 GMT',
  'content-type': 'application/json',
  'x-request-id': '...',
  'access-control-allow-origin': '*',
  'access-control-allow-headers': 'Authorization, Content-Type',
  ibm_cloud_functions: 'OpenWhisk',
  'x-global-transaction-id': '...',
  'set-cookie': 
   [ 'DPJSESSIONID=PBC5YS:...; Path=/; Domain=.openwhisk.ng.bluemix.net; Secure; HttpOnly' ] }

@jthomas
Copy link
Member

jthomas commented Jun 26, 2018

LGTM, do you want to open a PR around this?

@starpit
Copy link
Contributor Author

starpit commented Jun 26, 2018

yes, i'll try to get something in the next few days

@starpit starpit changed the title add debug calls? add debug calls? Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants