openai-node icon indicating copy to clipboard operation
openai-node copied to clipboard

process.env.DEBUG variable can have many values

Open OleksandrKucherenko opened this issue 2 years ago • 3 comments

Confirm this is a Node library issue and not an underlying OpenAI API issue

  • [X] This is an issue with the Node library

Describe the bug

process.env.DEBUG variable can be used by many libraries, for example: debug npm

more details: https://github.com/debug-js/debug#windows-command-prompt-notes

in other words DEBUG environment variable can be something more complicated than just a true or undefined.

To Reproduce

https://github.com/openai/openai-node/blob/master/src/core.ts#L994-L998

DEBUG=* yarn start:dev
DEBUG=*,-openai  yarn start:dev
DEBUG=openai yarn start:dev

Code snippets

https://github.com/openai/openai-node/blob/master/src/core.ts#L994-L998

 
DEBUG=* yarn start:dev # max verbosity
DEBUG=*,-openai  yarn start:dev # show all debug msgs except openai
DEBUG=openai yarn start:dev # show only openai logs

OS

macOs, Windows, Linux

Node version

any

Library version

4.6.0

OleksandrKucherenko avatar Sep 09 '23 08:09 OleksandrKucherenko

Thank you for the feature request; we'll think this over.

rattrayalex avatar Sep 09 '23 19:09 rattrayalex